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

Unified Diff: snapshot/minidump/minidump_simple_string_dictionary_reader.cc

Issue 972383002: snapshot: Add a minimal ModuleSnapshotMinidump and accessor from ProcessSnapshotMinidump (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Add NOTREACHED() comments Created 5 years, 10 months 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
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));
« no previous file with comments | « snapshot/minidump/minidump_simple_string_dictionary_reader.h ('k') | snapshot/minidump/minidump_string_list_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698