|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-08-11 12:25 UTC] sjon at hortensius dot net
Description: ------------ This only started happening in php-7, before that it would work better Test script: --------------- from http://3v4l.org/ToUVn <?php range(0, pow(2.0, 100000000)); Expected result: ---------------- Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate 32 bytes) in /in/ToUVn on line 2 Process exited with code 255. Actual result: -------------- Process exited with code 139. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
a fix could be: $ git diff diff --git a/ext/standard/array.c b/ext/standard/array.c index 7ef9d73..8745149 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1739,6 +1739,11 @@ double_str: high = zval_get_double(zhigh); i = 0; + if (zend_isinf(high) || zend_isinf(low)) { + php_error_docref(NULL, E_WARNING, "Range is too big"); + RETURN_FALSE; + } + Z_TYPE_INFO(tmp) = IS_DOUBLE; if (low > high) { /* Negative steps */ if (low - high < step || step <= 0) { but I am not sure what the proper error message should be?