From: Xinchen Hui Date: Wed, 9 Mar 2016 04:16:24 +0000 (+0800) Subject: Fixed bug #71729 (Possible crash in zend_bin_strtod, zend_oct_strtod, zend_hex_strtod) X-Git-Tag: php-7.0.5RC1~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9aa73d38000b9bb9de8dc8aa96e7dcef30506202;p=php Fixed bug #71729 (Possible crash in zend_bin_strtod, zend_oct_strtod, zend_hex_strtod) --- diff --git a/NEWS b/NEWS index 2580ca1cff..cbd51b626b 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ PHP NEWS . Fixed bug #69953 (Support MKCALENDAR request method). (Christoph) - Core: + . Fixed bug #71729 (Possible crash in zend_bin_strtod, zend_oct_strtod, + zend_hex_strtod). (Laruence) . Fixed bug #71695 (Global variables are reserved before execution). (Laruence) . Fixed bug #71629 (Out-of-bounds access in php_url_decode in context diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c index 0bdb8c08b5..22d509e4a7 100644 --- a/Zend/zend_strtod.c +++ b/Zend/zend_strtod.c @@ -4417,7 +4417,9 @@ ZEND_API double zend_hex_strtod(const char *str, const char **endptr) double value = 0; if (strlen(str) < 2) { - *endptr = str; + if (endptr != NULL) { + *endptr = str; + } return 0.0; } @@ -4455,7 +4457,9 @@ ZEND_API double zend_oct_strtod(const char *str, const char **endptr) int any = 0; if (strlen(str) < 1) { - *endptr = str; + if (endptr != NULL) { + *endptr = str; + } return 0.0; } @@ -4488,7 +4492,9 @@ ZEND_API double zend_bin_strtod(const char *str, const char **endptr) int any = 0; if (strlen(str) < 2) { - *endptr = str; + if (endptr != NULL) { + *endptr = str; + } return 0.0; }