Index: snapshot/minidump/minidump_simple_string_dictionary_reader.cc |
diff --git a/snapshot/minidump/minidump_simple_string_dictionary_reader.cc b/snapshot/minidump/minidump_simple_string_dictionary_reader.cc |
index 685266d74d5450da9eddcacad8263ca1ca8a154f..085c1f60dec33fe385b4a7bff4913de7f8f891a7 100644 |
--- a/snapshot/minidump/minidump_simple_string_dictionary_reader.cc |
+++ b/snapshot/minidump/minidump_simple_string_dictionary_reader.cc |
@@ -48,7 +48,8 @@ bool ReadMinidumpSimpleStringDictionary( |
} |
if (location.DataSize != |
- entry_count * sizeof(MinidumpSimpleStringDictionaryEntry)) { |
+ sizeof(MinidumpSimpleStringDictionary) + |
+ entry_count * sizeof(MinidumpSimpleStringDictionaryEntry)) { |
LOG(ERROR) << "simple_string_dictionary size mismatch"; |
return false; |
} |
@@ -63,19 +64,17 @@ bool ReadMinidumpSimpleStringDictionary( |
for (const MinidumpSimpleStringDictionaryEntry& entry : entries) { |
std::string key; |
if (!ReadMinidumpUTF8String(file_reader, entry.key, &key)) { |
- // Not a hard error, keep trying. |
- continue; |
+ return false; |
} |
std::string value; |
if (!ReadMinidumpUTF8String(file_reader, entry.value, &value)) { |
- // Not a hard error, keep trying. |
- continue; |
+ return false; |
} |
if (local_dictionary.find(key) != local_dictionary.end()) { |
LOG(WARNING) << "duplicate key " << key << ", discarding value " << value; |
- continue; |
+ return false; |
} |
local_dictionary.insert(std::make_pair(key, value)); |