com php-src: Fixed bug #70239 Creating a huge array doesn't result in exhausted, but segfault: ext/standard/array.c
| From: | Anatol Belski | Date: | Fri, 14 Aug 2015 12:34:47 +0000 |
| Subject: | com php-src: Fixed bug #70239 Creating a huge array doesn't result in exhausted, but segfault: ext/standard/array.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88532@lists.php.net to get a copy of this message | ||
Commit: 01ee09f3f70284183679d403d2a2ae1928689573
Author: Anatol Belski <ab@php.net> Thu, 13 Aug 2015 18:16:26 +0200
Parents: ad27aded5c9b8f50b2481a716ba61ab24265ad23
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=01ee09f3f70284183679d403d2a2ae1928689573
Log:
Fixed bug #70239 Creating a huge array doesn't result in exhausted, but segfault
Bugs:
https://bugs.php.net/70239
Changed paths:
M ext/standard/array.c
Diff:
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 14c4ef5..ddbbe4c 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) {