com php-src: Fixed bug #71729 (Possible crash in zend_bin_s trtod, zend_oct_strtod, zend_hex_strtod): NEWS Zend/zend_strtod.c
| From: | Xinchen Hui | Date: | Wed, 09 Mar 2016 04:16:24 +0000 |
| Subject: | com php-src: Fixed bug #71729 (Possible crash in zend_bin_s trtod, zend_oct_strtod, zend_hex_strtod): NEWS Zend/zend_strtod.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91286@lists.php.net to get a copy of this message | ||
Commit: 9aa73d38000b9bb9de8dc8aa96e7dcef30506202
Author: Xinchen Hui <laruence@gmail.com> Wed, 9 Mar 2016 12:16:24 +0800
Parents: 7a4c2fa829bc5a5ae731febe2cf7a74167012e37
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9aa73d38000b9bb9de8dc8aa96e7dcef30506202
Log:
Fixed bug #71729 (Possible crash in zend_bin_strtod, zend_oct_strtod, zend_hex_strtod)
Bugs:
https://bugs.php.net/71729
Changed paths:
M NEWS
M Zend/zend_strtod.c
Diff:
diff --git a/NEWS b/NEWS
index 2580ca1..cbd51b6 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 0bdb8c0..22d509e 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;
}