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

Unified Diff: components/nacl/browser/pnacl_host.cc

Issue 2528243002: Fix silent truncations when extracting values from CheckedNumeric (Closed)
Patch Set: compile cleanup and fix Created 4 years, 1 month 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: components/nacl/browser/pnacl_host.cc
diff --git a/components/nacl/browser/pnacl_host.cc b/components/nacl/browser/pnacl_host.cc
index 1dacf669a9ea96ae519c28607b1698c35e7958a0..605d7d71d049fe9dd14c96765da8cbff55027f25 100644
--- a/components/nacl/browser/pnacl_host.cc
+++ b/components/nacl/browser/pnacl_host.cc
@@ -418,8 +418,8 @@ scoped_refptr<net::DrainableIOBuffer> PnaclHost::CopyFileToBuffer(
}
buffer = new net::DrainableIOBuffer(
- new net::IOBuffer(base::CheckedNumeric<size_t>(file_size).ValueOrDie()),
- base::CheckedNumeric<size_t>(file_size).ValueOrDie());
+ new net::IOBuffer(base::checked_cast<size_t>(file_size)),
+ base::checked_cast<size_t>(file_size));
if (file->Read(0, buffer->data(), buffer->size()) != file_size) {
PLOG(ERROR) << "CopyFileToBuffer file read failed";
buffer = nullptr;

Powered by Google App Engine
This is Rietveld 408576698