diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2020-07-30 23:06:47 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-07-30 23:06:47 +0000 |
commit | f68bc249a948a0e6f41aae44f28e5b9d33d2651f (patch) | |
tree | 37f2ba30cccbecdf735bb81780db531e8761fe0e /adb/client/incremental.cpp | |
parent | 000b95afe838c708d3148fd46f4845a2c91a0504 (diff) | |
parent | fbcc431f56914c59fb090e04fe90642ead351670 (diff) |
Merge "[incremental/adb] fix signature size check" am: 1c5a205fda am: fbcc431f56
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1373276
Change-Id: I5c653e463611670f7ad9e998c022a61517792a90
Diffstat (limited to 'adb/client/incremental.cpp')
-rw-r--r-- | adb/client/incremental.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/adb/client/incremental.cpp b/adb/client/incremental.cpp index 3033059d01..60735f8c5e 100644 --- a/adb/client/incremental.cpp +++ b/adb/client/incremental.cpp @@ -55,9 +55,10 @@ static std::pair<unique_fd, std::vector<char>> read_signature(Size file_size, 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) { fprintf(stderr, "Signature is too long. Max allowed is %d. Abort.\n", 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)}; } - auto [signature, tree_size] = read_id_sig_headers(fd); if (auto expected = verity_tree_size_for_file(file_size); tree_size != expected) { if (!silent) { fprintf(stderr, |