Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Unified Diff: base/pickle.h

Issue 4716006: Pickle: handle invalid data on 64 bit systems.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/pickle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/pickle.h
===================================================================
--- base/pickle.h (revision 65620)
+++ base/pickle.h (working copy)
@@ -177,10 +177,12 @@
// 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 {
« no previous file with comments | « no previous file | base/pickle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698