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

Unified Diff: snapshot/minidump/process_snapshot_minidump.cc

Issue 1283243004: ubsan: Don’t call v[0] on empty vectors (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « snapshot/mac/mach_o_image_segment_reader.cc ('k') | util/mac/xattr.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/minidump/process_snapshot_minidump.cc
diff --git a/snapshot/minidump/process_snapshot_minidump.cc b/snapshot/minidump/process_snapshot_minidump.cc
index fa87981b5c2437e87d923f15bd53081c863c0381..5344118c169f91956d92a213230dbc74bf92d9ca 100644
--- a/snapshot/minidump/process_snapshot_minidump.cc
+++ b/snapshot/minidump/process_snapshot_minidump.cc
@@ -65,7 +65,8 @@ bool ProcessSnapshotMinidump::Initialize(FileReaderInterface* file_reader) {
}
stream_directory_.resize(header_.NumberOfStreams);
- if (!file_reader_->ReadExactly(
+ if (!stream_directory_.empty() &&
+ !file_reader_->ReadExactly(
&stream_directory_[0],
header_.NumberOfStreams * sizeof(stream_directory_[0]))) {
return false;
« no previous file with comments | « snapshot/mac/mach_o_image_segment_reader.cc ('k') | util/mac/xattr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698