diff options
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | Zend/zend_hash.h | 8 |
2 files changed, 5 insertions, 4 deletions
@@ -15,6 +15,7 @@ - Fixed bug #52436 (Compile error if systems do not have stdint.h) (Sriram Natarajan) - Fixed bug #52390 (mysqli_report() should be per-request setting). (Kalle) +- Fixed bug #51008 (Zend/tests/bug45877.phpt fails). (Dmitry) 22 Jul 2010, PHP 5.2.14 - Reverted bug fix #49521 (PDO fetchObject sets values before calling diff --git a/Zend/zend_hash.h b/Zend/zend_hash.h index 0d8f5fe976..c4b963e2a7 100644 --- a/Zend/zend_hash.h +++ b/Zend/zend_hash.h @@ -306,7 +306,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 */ \ @@ -322,11 +322,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; \ |