summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2016-12-17 01:24:09 +0100
committerTianjie Xu <xunchang@google.com>2016-12-17 01:24:09 +0100
commit54ea136fded56810bf475885eb4bd7bf1b11f09c (patch)
treefe5e271c356a3a6eea24e86bbecd620d87b032e7
parentresolve merge conflicts of 86a28d0 to klp-modular-dev (diff)
downloadandroid_bootable_recovery-54ea136fded56810bf475885eb4bd7bf1b11f09c.tar
android_bootable_recovery-54ea136fded56810bf475885eb4bd7bf1b11f09c.tar.gz
android_bootable_recovery-54ea136fded56810bf475885eb4bd7bf1b11f09c.tar.bz2
android_bootable_recovery-54ea136fded56810bf475885eb4bd7bf1b11f09c.tar.lz
android_bootable_recovery-54ea136fded56810bf475885eb4bd7bf1b11f09c.tar.xz
android_bootable_recovery-54ea136fded56810bf475885eb4bd7bf1b11f09c.tar.zst
android_bootable_recovery-54ea136fded56810bf475885eb4bd7bf1b11f09c.zip
-rw-r--r--verifier.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/verifier.cpp b/verifier.cpp
index eeff95a59..3d4f603a2 100644
--- a/verifier.cpp
+++ b/verifier.cpp
@@ -143,6 +143,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;