summaryrefslogtreecommitdiffstats
path: root/base/pickle.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/pickle.cc')
-rw-r--r--base/pickle.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/base/pickle.cc b/base/pickle.cc
index 3f376e3..7745527 100644
--- a/base/pickle.cc
+++ b/base/pickle.cc
@@ -406,6 +406,9 @@ const char* Pickle::FindNext(size_t header_size,
DCHECK(header_size == AlignInt(header_size, sizeof(uint32)));
DCHECK(header_size <= static_cast<size_t>(kPayloadUnit));
+ if (static_cast<size_t>(end - start) < sizeof(Header))
+ return NULL;
+
const Header* hdr = reinterpret_cast<const Header*>(start);
const char* payload_base = start + header_size;
const char* payload_end = payload_base + hdr->payload_size;