]> granicus.if.org Git - php/commitdiff
Suppress overflow UB in zend_strtod
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 19 Jun 2019 13:57:57 +0000 (15:57 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 19 Jun 2019 13:57:57 +0000 (15:57 +0200)
Zend/zend_strtod.c

index 96d3ec8c95817cbcec7ae7867c61a5df0874e327..08f8424e8c5b4d81a8798e27dc129e7b1a0a8676 100644 (file)
@@ -2705,7 +2705,7 @@ zend_strtod
                                L = c - '0';
                                s1 = s;
                                while((c = *++s) >= '0' && c <= '9')
-                                       L = 10*L + (c - '0');
+                                       L = (Long) (10*(ULong)L + (c - '0'));
                                if (s - s1 > 8 || L > 19999)
                                        /* Avoid confusion from exponents
                                         * so large that e might overflow.