summaryrefslogtreecommitdiffstats
path: root/verifier.cpp
diff options
context:
space:
mode:
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 3beaa6e02..6daeac94e 100644
--- a/verifier.cpp
+++ b/verifier.cpp
@@ -148,6 +148,12 @@ int verify_file(unsigned char* addr, size_t length, const std::vector<Certificat
LOG(INFO) << "comment is " << comment_size << " bytes; signature is " << signature_start
<< " bytes from end";
+ if (signature_start > comment_size) {
+ LOG(ERROR) << "signature start: " << signature_start << " is larger than comment size: "
+ << comment_size;
+ return VERIFY_FAILURE;
+ }
+
if (signature_start <= FOOTER_SIZE) {
LOG(ERROR) << "Signature start is in the footer";
return VERIFY_FAILURE;