summaryrefslogtreecommitdiff
path: root/Zend/zend_strtod.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2016-11-05 13:20:24 -0700
committerStanislav Malyshev <stas@php.net>2016-11-05 13:22:17 -0700
commit669763d88a8bb9707a45f0937a129b63a161d2f0 (patch)
tree88a1fc19403a330c9a50e7095ee0a8844445b993 /Zend/zend_strtod.c
parentd858b4c77fa28ff9b0a597141a58f51803bafc2b (diff)
downloadphp-git-669763d88a8bb9707a45f0937a129b63a161d2f0.tar.gz
More int->size_t and string overflow fixes
Diffstat (limited to 'Zend/zend_strtod.c')
-rw-r--r--Zend/zend_strtod.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c
index 889a31685c..d15048b7e5 100644
--- a/Zend/zend_strtod.c
+++ b/Zend/zend_strtod.c
@@ -2677,6 +2677,14 @@ zend_strtod
}
}
dig_done:
+ if (nd < 0) {
+ /* overflow */
+ nd = DBL_DIG + 2;
+ }
+ if (nf < 0) {
+ /* overflow */
+ nf = DBL_DIG + 2;
+ }
e = 0;
if (c == 'e' || c == 'E') {
if (!nd && !nz && !nz0) {
@@ -4543,7 +4551,7 @@ static void destroy_freelist(void)
}
freelist[i] = NULL;
}
- FREE_DTOA_LOCK(0)
+ FREE_DTOA_LOCK(0)
}
#ifdef __cplusplus