cvs: php-src /ext/standard array.c /ext/standard/tests/array bug32021.phpt
| From: | Derick Rethans | Date: | Fri, 18 Feb 2005 13:37:24 +0000 |
| Subject: | cvs: php-src /ext/standard array.c /ext/standard/tests/array bug32021.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-30478@lists.php.net to get a copy of this message | ||
derick Fri Feb 18 08:37:24 2005 EDT
Added files:
/php-src/ext/standard/tests/array bug32021.phpt
Modified files:
/php-src/ext/standard array.c
Log:
- Fixed bug #32021: Crash caused by range('', 'z')
http://cvs.php.net/diff.php/php-src/ext/standard/array.c?r1=1.290&r2=1.291&ty=u
Index: php-src/ext/standard/array.c
diff -u php-src/ext/standard/array.c:1.290 php-src/ext/standard/array.c:1.291
--- php-src/ext/standard/array.c:1.290 Thu Feb 10 17:59:26 2005
+++ php-src/ext/standard/array.c Fri Feb 18 08:37:23 2005
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: array.c,v 1.290 2005/02/10 22:59:26 rrichards Exp $ */
+/* $Id: array.c,v 1.291 2005/02/18 13:37:23 derick Exp $ */
#include "php.h"
#include "php_ini.h"
@@ -1590,7 +1590,7 @@
array_init(return_value);
/* If the range is given as strings, generate an array of characters. */
- if (Z_TYPE_P(zlow) == IS_STRING && Z_TYPE_P(zhigh) == IS_STRING) {
+ if (Z_TYPE_P(zlow) == IS_STRING && Z_TYPE_P(zhigh) == IS_STRING &&
Z_STRLEN_P(zlow) >= 1 && Z_STRLEN_P(zhigh) >= 1) {
int type1, type2;
unsigned char *low, *high;
long lstep = (long) step;
http://cvs.php.net/co.php/php-src/ext/standard/tests/array/bug32021.phpt?r=1.1&p=1
Index: php-src/ext/standard/tests/array/bug32021.phpt
+++ php-src/ext/standard/tests/array/bug32021.phpt
--TEST--
Bug #32021 (Crash caused by range('', 'z'))
--FILE--
<?php
$foo = range('', 'z');
var_dump($foo);
?>
ALIVE
--EXPECT--
array(1) {
[0]=>
int(0)
}
ALIVE