Index: src/snapshot/code-serializer.cc |
diff --git a/src/snapshot/code-serializer.cc b/src/snapshot/code-serializer.cc |
index 16044a505953686c58d0474803458a2d4bacb606..9712d79e19ed27c214112d4476bd9d256ddb3347 100644 |
--- a/src/snapshot/code-serializer.cc |
+++ b/src/snapshot/code-serializer.cc |
@@ -340,6 +340,7 @@ SerializedCodeData::SerializedCodeData(const List<byte>* payload, |
SerializedCodeData::SanityCheckResult SerializedCodeData::SanityCheck( |
Isolate* isolate, uint32_t expected_source_hash) const { |
+ if (this->size_ < kHeaderSize) return INVALID_HEADER; |
uint32_t magic_number = GetMagicNumber(); |
if (magic_number != ComputeMagicNumber(isolate)) return MAGIC_NUMBER_MISMATCH; |
uint32_t version_hash = GetHeaderValue(kVersionHashOffset); |