]> granicus.if.org Git - php/commitdiff
Fixed bug #72172 (zend_hex_strtod should not use strlen)
authorXinchen Hui <laruence@gmail.com>
Sat, 7 May 2016 06:52:06 +0000 (23:52 -0700)
committerXinchen Hui <laruence@gmail.com>
Sat, 7 May 2016 06:52:06 +0000 (23:52 -0700)
NEWS
Zend/zend_strtod.c

diff --git a/NEWS b/NEWS
index 12dfcf4dd88c1a96887dd4cb68518ceeb5322c57..9679e04bdc181d6d86fb03b6330a81fd847de8cc 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2016, PHP 5.6.22
 
+ - Core:
+  . Fixed bug #72172 (zend_hex_strtod should not use strlen).
+    (bwitz at hotmail dot com )
+
 28 Apr 2016, PHP 5.6.21
 
 - Core: 
index 4546614cfdf7f2b0ffa294d56544febc05d87b67..e74cf0eb82070cfa6c591d00d9f4b93399a26166 100644 (file)
@@ -2590,7 +2590,7 @@ ZEND_API double zend_hex_strtod(const char *str, const char **endptr)
        int any = 0;
        double value = 0;
 
-       if (strlen(str) < 2) {
+       if (s[0] == '\0' || s[1] == '\0') {
                *endptr = str;
                return 0.0;
        }