diff options
author | rsesek@chromium.org <rsesek@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-05-08 16:06:33 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2013-05-08 16:06:33 +0000 |
commit | df6f45b04bbf304b009ec69334e7079b27e83bec (patch) | |
tree | e1d21f12dd626f48ce3e47b0280618817eb26e07 /src/common/simple_string_dictionary.h | |
parent | Make x86-64 stack walking work for Native Client minidumps (diff) | |
download | breakpad-df6f45b04bbf304b009ec69334e7079b27e83bec.tar.xz |
NULL-check the entry in NonAllocatingMap before setting on it.
Using just an assert will still cause a crash in a release build.
BUG=http://code.google.com/p/chromium/issues/detail?id=238757
R=mark@chromium.org
Review URL: https://breakpad.appspot.com/593003
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1174 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/simple_string_dictionary.h')
-rw-r--r-- | src/common/simple_string_dictionary.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/simple_string_dictionary.h b/src/common/simple_string_dictionary.h index 20440f60..e241aff5 100644 --- a/src/common/simple_string_dictionary.h +++ b/src/common/simple_string_dictionary.h @@ -156,7 +156,8 @@ class NonAllocatingMap { // Stores |value| into |key|, replacing the existing value if |key| is // already present. |key| must not be NULL. If |value| is NULL, the key is - // removed from the map. + // removed from the map. If there is no more space in the map, then the + // operation silently fails. void SetKeyValue(const char* key, const char* value) { if (!value) { RemoveKey(key); @@ -191,7 +192,8 @@ class NonAllocatingMap { } // If the map is out of space, entry will be NULL. - assert(entry); + if (!entry) + return; #ifndef NDEBUG // Sanity check that the key only appears once. |