File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1561,8 +1561,6 @@ class GenericReader {
1561
1561
// Force double for big integer
1562
1562
if (useDouble) {
1563
1563
while (RAPIDJSON_LIKELY (s.Peek () >= ' 0' && s.Peek () <= ' 9' )) {
1564
- if (RAPIDJSON_UNLIKELY (d >= 1.7976931348623157e307 )) // DBL_MAX / 10.0
1565
- RAPIDJSON_PARSE_ERROR (kParseErrorNumberTooBig , startOffset);
1566
1564
d = d * 10 + (s.TakePush () - ' 0' );
1567
1565
}
1568
1566
}
@@ -1702,6 +1700,12 @@ class GenericReader {
1702
1700
else
1703
1701
d = internal::StrtodNormalPrecision (d, p);
1704
1702
1703
+ if (d == std::numeric_limits<double >::infinity ()) {
1704
+ // Overflow
1705
+ // TODO: internal::StrtodX should report overflow (or underflow)
1706
+ RAPIDJSON_PARSE_ERROR (kParseErrorNumberTooBig , startOffset);
1707
+ }
1708
+
1705
1709
cont = handler.Double (minus ? -d : d);
1706
1710
}
1707
1711
else if (useNanOrInf) {
You can’t perform that action at this time.
0 commit comments