summaryrefslogtreecommitdiffstats
path: root/base/pickle.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/pickle.h')
-rw-r--r--base/pickle.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/pickle.h b/base/pickle.h
index c7aee67..6006e62 100644
--- a/base/pickle.h
+++ b/base/pickle.h
@@ -177,10 +177,12 @@ class Pickle {
// Returns the address of the byte immediately following the currently valid
// header + payload.
char* end_of_payload() {
+ // We must have a valid header_.
return payload() + payload_size();
}
const char* end_of_payload() const {
- return payload() + payload_size();
+ // This object may be invalid.
+ return header_ ? payload() + payload_size() : NULL;
}
size_t capacity() const {