summaryrefslogtreecommitdiffstats
path: root/verifier.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2017-01-18 23:28:46 +0100
committerandroid-build-merger <android-build-merger@google.com>2017-01-18 23:28:46 +0100
commit6ea9888d51656b3253d5dda9bcc3234f2912ad4e (patch)
treefd8ea77ea19e10e3fca4927b296d5c65463589bb /verifier.cpp
parentresolve merge conflicts of 86a28d0 to klp-modular-dev am: a5bc59620f am: 36acff7d7e am: 1f814d7630 am: ca45737e27 am: 8a1d4e97ad (diff)
parentAdd a checker for signature boundary in verifier am: 54ea136fde am: 0a34b17c8b (diff)
downloadandroid_bootable_recovery-6ea9888d51656b3253d5dda9bcc3234f2912ad4e.tar
android_bootable_recovery-6ea9888d51656b3253d5dda9bcc3234f2912ad4e.tar.gz
android_bootable_recovery-6ea9888d51656b3253d5dda9bcc3234f2912ad4e.tar.bz2
android_bootable_recovery-6ea9888d51656b3253d5dda9bcc3234f2912ad4e.tar.lz
android_bootable_recovery-6ea9888d51656b3253d5dda9bcc3234f2912ad4e.tar.xz
android_bootable_recovery-6ea9888d51656b3253d5dda9bcc3234f2912ad4e.tar.zst
android_bootable_recovery-6ea9888d51656b3253d5dda9bcc3234f2912ad4e.zip
Diffstat (limited to 'verifier.cpp')
-rw-r--r--verifier.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/verifier.cpp b/verifier.cpp
index 61e5adf0b..bf7071d13 100644
--- a/verifier.cpp
+++ b/verifier.cpp
@@ -144,6 +144,12 @@ int verify_file(unsigned char* addr, size_t length,
LOGI("comment is %zu bytes; signature %zu bytes from end\n",
comment_size, signature_start);
+ if (signature_start > comment_size) {
+ LOGE("signature start: %zu is larger than comment size: %zu\n", signature_start,
+ comment_size);
+ return VERIFY_FAILURE;
+ }
+
if (signature_start <= FOOTER_SIZE) {
LOGE("Signature start is in the footer");
return VERIFY_FAILURE;