summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--verifier.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/verifier.cpp b/verifier.cpp
index 44098f70e..22f15235b 100644
--- a/verifier.cpp
+++ b/verifier.cpp
@@ -147,6 +147,12 @@ int verify_file(unsigned char* addr, size_t length,
LOG(INFO) << "comment is " << comment_size << " bytes; signature is " << signature_start
<< " bytes from end";
+ 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) {
LOG(ERROR) << "Signature start is in the footer";
return VERIFY_FAILURE;