summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2010-10-05 11:28:56 +0000
committerDmitry Stogov <dmitry@php.net>2010-10-05 11:28:56 +0000
commit455db21e064e1fc43d1150a81a4d3dc96556f846 (patch)
tree832d04fc6aac45fde1de4e43da6376f1118c592c
parentbf7e6f930c11a5aecf12bb916ab1d97463ff0333 (diff)
downloadphp-git-455db21e064e1fc43d1150a81a4d3dc96556f846.tar.gz
Fixed bug #51008 (Zend/tests/bug45877.phpt fails)
-rw-r--r--NEWS1
-rw-r--r--Zend/zend_hash.h8
2 files changed, 5 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 6f8a5212e0..b26b207d4b 100644
--- a/NEWS
+++ b/NEWS
@@ -107,6 +107,7 @@
- Fixed bug #51610 (Using oci_connect causes PHP to take a long time to
exit). Requires Oracle bug fix 9891199 for this patch to have an
effect. (Oracle Corp.)
+- Fixed bug #51008 (Zend/tests/bug45877.phpt fails). (Dmitry)
- Fixed bug #50590 (IntlDateFormatter::parse result is limited to the integer
range). (Stas)
- Fixed bug #50481 (Storing many SPLFixedArray in an array crashes). (Felipe)
diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h
index bc88e0efab..9cb17a17d9 100644
--- a/Zend/zend_hash.h
+++ b/Zend/zend_hash.h
@@ -312,7 +312,7 @@ END_EXTERN_C()
} \
if (*tmp >= '0' && *tmp <= '9') { /* possibly a numeric index */ \
const char *end = key + length - 1; \
- long idx; \
+ ulong idx; \
\
if ((*end != '\0') /* not a null terminated string */ \
|| (*tmp == '0' && length > 2) /* numbers with leading zeros */ \
@@ -328,11 +328,11 @@ END_EXTERN_C()
} \
if (tmp == end) { \
if (*key == '-') { \
- idx = -idx; \
- if (idx > 0) { /* overflow */ \
+ if (idx-1 > LONG_MAX) { /* overflow */ \
break; \
} \
- } else if (idx < 0) { /* overflow */ \
+ idx = (ulong)(-(long)idx); \
+ } else if (idx > LONG_MAX) { /* overflow */ \
break; \
} \
return func; \