diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-02-13 02:12:42 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-02-13 02:12:42 +0300 |
commit | 12abac8bb78c494597d740e7f9afd202f63180a3 (patch) | |
tree | 811a7a1a5efd2e1e90cc02b14ee89ee1a048dec0 /Zend/zend_string.c | |
parent | 2fb85f1058fd7cc7778afa5d3fef24948cbe2ac7 (diff) | |
download | php-git-12abac8bb78c494597d740e7f9afd202f63180a3.tar.gz |
Limit HashTable size to avoid integer overflow checks
Diffstat (limited to 'Zend/zend_string.c')
-rw-r--r-- | Zend/zend_string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Zend/zend_string.c b/Zend/zend_string.c index ccd95e51f4..634e2c8104 100644 --- a/Zend/zend_string.c +++ b/Zend/zend_string.c @@ -106,7 +106,7 @@ static zend_string *zend_new_interned_string_int(zend_string *str) GC_FLAGS(str) |= IS_STR_INTERNED; if (CG(interned_strings).nNumUsed >= CG(interned_strings).nTableSize) { - if ((CG(interned_strings).nTableSize << 1) > 0) { /* Let's double the table size */ + if (CG(interned_strings).nTableSize < HT_MAX_SIZE) { /* Let's double the table size */ Bucket *d = (Bucket *) perealloc_recoverable(CG(interned_strings).arData, (CG(interned_strings).nTableSize << 1) * sizeof(Bucket), 1); uint32_t *h = (uint32_t *) perealloc_recoverable(CG(interned_strings).arHash, (CG(interned_strings).nTableSize << 1) * sizeof(uint32_t), 1); |