Merge "[incremental/adb] fix signature size check" am: 1c5a205fda
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1373276 Change-Id: I676de9e59f89c8711268afaf4b9a3caf705f7cab
This commit is contained in:
commit
fbcc431f56
1 changed files with 3 additions and 3 deletions
|
|
@ -55,9 +55,10 @@ static std::pair<unique_fd, std::vector<char>> read_signature(Size file_size,
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<char> invalid_signature;
|
auto [signature, tree_size] = read_id_sig_headers(fd);
|
||||||
|
|
||||||
if (st.st_size > kMaxSignatureSize) {
|
std::vector<char> invalid_signature;
|
||||||
|
if (signature.size() > kMaxSignatureSize) {
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
fprintf(stderr, "Signature is too long. Max allowed is %d. Abort.\n",
|
fprintf(stderr, "Signature is too long. Max allowed is %d. Abort.\n",
|
||||||
kMaxSignatureSize);
|
kMaxSignatureSize);
|
||||||
|
|
@ -65,7 +66,6 @@ static std::pair<unique_fd, std::vector<char>> read_signature(Size file_size,
|
||||||
return {std::move(fd), std::move(invalid_signature)};
|
return {std::move(fd), std::move(invalid_signature)};
|
||||||
}
|
}
|
||||||
|
|
||||||
auto [signature, tree_size] = read_id_sig_headers(fd);
|
|
||||||
if (auto expected = verity_tree_size_for_file(file_size); tree_size != expected) {
|
if (auto expected = verity_tree_size_for_file(file_size); tree_size != expected) {
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue