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

Unified Diff: base/third_party/dmg_fp/exp_length.patch

Issue 2451573005: Fix integer-overflow in dmg_fp::strtod (Closed)
Patch Set: Created 4 years, 2 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 | « base/third_party/dmg_fp/dtoa.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/third_party/dmg_fp/exp_length.patch
diff --git a/base/third_party/dmg_fp/exp_length.patch b/base/third_party/dmg_fp/exp_length.patch
index 7a6d691dfb0edff68130052430432e516c2d4a74..278ec17b2890e8b16a8dfb4cbecfdfc3bd47a473 100644
--- a/base/third_party/dmg_fp/exp_length.patch
+++ b/base/third_party/dmg_fp/exp_length.patch
@@ -10,7 +10,7 @@ index c0a51c2..ab4e056 100644
- L = 10*L + c - '0';
+ while((c = *++s) >= '0' && c <= '9') {
+ if (L < (INT_MAX - 10) / 10) {
-+ L = 10*L + c - '0';
++ L = 10*L + (c - '0');
+ }
+ }
if (s - s1 > 8 || L > 19999)
« no previous file with comments | « base/third_party/dmg_fp/dtoa.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698