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

Unified Diff: chrome/utility/safe_browsing/mac/hfs.cc

Issue 2141963002: Validate safe_browsing::dmg::UDIFBlock data before attempting to read at its offsets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 5 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 | « no previous file | chrome/utility/safe_browsing/mac/udif.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/safe_browsing/mac/hfs.cc
diff --git a/chrome/utility/safe_browsing/mac/hfs.cc b/chrome/utility/safe_browsing/mac/hfs.cc
index f984636e316bed050ea7008111aaf336c14844c7..9a27223be375a2cc0455541c930eff3ffb27d15e 100644
--- a/chrome/utility/safe_browsing/mac/hfs.cc
+++ b/chrome/utility/safe_browsing/mac/hfs.cc
@@ -369,7 +369,10 @@ bool HFSForkReadStream::Read(uint8_t* buffer,
// Read the entire extent now, to avoid excessive seeking and re-reading.
if (!read_current_extent_) {
- hfs_->SeekToBlock(extent->startBlock);
+ if (!hfs_->SeekToBlock(extent->startBlock)) {
+ DLOG(ERROR) << "Failed to seek to block " << extent->startBlock;
+ return false;
+ }
current_extent_data_.resize(extent_size.ValueOrDie());
if (!hfs_->stream()->ReadExact(&current_extent_data_[0],
extent_size.ValueOrDie())) {
« no previous file with comments | « no previous file | chrome/utility/safe_browsing/mac/udif.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698