summaryrefslogtreecommitdiff
path: root/ext/standard/array.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2015-08-13 18:16:26 +0200
committerAnatol Belski <ab@php.net>2015-08-14 14:34:47 +0200
commit01ee09f3f70284183679d403d2a2ae1928689573 (patch)
tree4f3e8693dc0ddd419498aee93ccb2b74d25ea435 /ext/standard/array.c
parentad27aded5c9b8f50b2481a716ba61ab24265ad23 (diff)
downloadphp-git-01ee09f3f70284183679d403d2a2ae1928689573.tar.gz
Fixed bug #70239 Creating a huge array doesn't result in exhausted, but segfault
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r--ext/standard/array.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 14c4ef5311..ddbbe4cafe 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -1740,6 +1740,11 @@ double_str:
high = zval_get_double(zhigh);
i = 0;
+ if (zend_isinf(high) || zend_isinf(low)) {
+ php_error_docref(NULL, E_WARNING, "Invalid range supplied: start=%0.0f end=%0.0f", low, high);
+ RETURN_FALSE;
+ }
+
Z_TYPE_INFO(tmp) = IS_DOUBLE;
if (low > high) { /* Negative steps */
if (low - high < step || step <= 0) {