From 1c7f608071110a8e90e4ae04d3b4d970a70f8c7d Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 6 May 2016 23:52:06 -0700 Subject: [PATCH] Fixed bug #72172 (zend_hex_strtod should not use strlen) --- NEWS | 4 ++++ Zend/zend_strtod.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 12dfcf4dd8..9679e04bdc 100644 --- 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: diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c index 4546614cfd..e74cf0eb82 100644 --- a/Zend/zend_strtod.c +++ b/Zend/zend_strtod.c @@ -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; } -- 2.40.0