[PATCH] Bug #45877: LONG_MAX/MIN array key as string/int
| From: | Matt Wilmas | Date: | Tue, 17 Mar 2009 18:30:49 +0000 |
| Subject: | [PATCH] Bug #45877: LONG_MAX/MIN array key as string/int | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-43382@lists.php.net to get a copy of this message | ||
Hi all,
Assuming there are no objections, I'll commit this fix in a few hours...
Besides the bug report(s), I had also found awhile ago that currently an array key can be LONG_MAX or LONG_MIN as a string and/or integer because of a check in ZEND_HANDLE_NUMERIC() (I assume to avoid a slow errno check for ERANGE originally). I changed it to use the *same method* that's used in the scanner, is_numeric_string(), etc., and those 2 values are now treated as an integer.
It's just a few lines changed in zend_hash.h, although I had to move some of the definitions from zend_operators.h to zend.h (is that OK?).
Patches (didn't check HEAD's yet):
http://realplain.com/php/array_key_limit.diff
http://realplain.com/php/array_key_limit_5_3.diff
- Matt