The exponent is accumulated in an int without limit, so a long run of
exponent digits makes it wrap. Stop accumulating once it exceeds 100000:
the result is then already zero or infinite for a double.
This should be backported along with the previous patch.
p++;
if (p < end_p && *p == '-') p++, neg++;
if (p < end_p && *p == '+') p++;
- while (p < end_p && is_digit(*p)) e = e * 10 + *p++ - '0';
+ while (p < end_p && is_digit(*p)) {
+ /* beyond this, 10^e is already infinite or zero for a double */
+ if (e < 100000) e = e * 10 + *p - '0';
+ p++;
+ }
i = e;
if (neg) e = -e;
#if 0