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

Unified Diff: third_party/crashpad/crashpad/util/file/string_file.cc

Issue 2528243002: Fix silent truncations when extracting values from CheckedNumeric (Closed)
Patch Set: compile fix Created 4 years 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 | « third_party/crashpad/README.chromium ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/crashpad/crashpad/util/file/string_file.cc
diff --git a/third_party/crashpad/crashpad/util/file/string_file.cc b/third_party/crashpad/crashpad/util/file/string_file.cc
index 1c74b3f0c0169a347a86977f87f101c67defc6bc..959b0a5398331a2e0c7a36bc70895fcd862a03ed 100644
--- a/third_party/crashpad/crashpad/util/file/string_file.cc
+++ b/third_party/crashpad/crashpad/util/file/string_file.cc
@@ -157,17 +157,16 @@ FileOffset StringFile::Seek(FileOffset offset, int whence) {
LOG(ERROR) << "Seek(): new_offset invalid";
return -1;
}
- FileOffset new_offset_fileoffset = new_offset.ValueOrDie();
size_t new_offset_sizet;
- if (!AssignIfInRange(&new_offset_sizet, new_offset_fileoffset)) {
- LOG(ERROR) << "Seek(): new_offset " << new_offset_fileoffset
+ if (!new_offset.AssignIfValid(&new_offset_sizet)) {
+ LOG(ERROR) << "Seek(): new_offset " << new_offset.ValueOrDie()
<< " invalid for size_t";
return -1;
}
offset_ = new_offset_sizet;
- return offset_.ValueOrDie();
+ return base::ValueOrDieForType<FileOffset>(offset_);
}
} // namespace crashpad
« no previous file with comments | « third_party/crashpad/README.chromium ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698