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

Unified Diff: base/third_party/dmg_fp/dtoa.cc

Issue 2296503003: Fix parsing of exponents in StringToDouble. (Closed)
Patch Set: Created 4 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
Index: base/third_party/dmg_fp/dtoa.cc
diff --git a/base/third_party/dmg_fp/dtoa.cc b/base/third_party/dmg_fp/dtoa.cc
index 502c16cc72f3ccc7ff217434ebf011e07acbf4a7..f3d793edc48be86dbf7e43839a0fe2e20f731d14 100644
--- a/base/third_party/dmg_fp/dtoa.cc
+++ b/base/third_party/dmg_fp/dtoa.cc
@@ -2597,8 +2597,11 @@ strtod
if (c > '0' && c <= '9') {
L = c - '0';
s1 = s;
- while((c = *++s) >= '0' && c <= '9')
+ while((c = *++s) >= '0' && c <= '9') {
L = 10*L + c - '0';
+ if (L > DBL_MAX_10_EXP)
+ break;
+ }
if (s - s1 > 8 || L > 19999)
/* Avoid confusion from exponents
* so large that e might overflow.

Powered by Google App Engine
This is Rietveld 408576698