Skip to content

Commit 2b19077

Browse files
authored
zend_hash_check_size: allow nSize <= HT_MAX_SIZE (#10244)
This is consistent with other uses of HT_MAX_SIZE
1 parent 7473b86 commit 2b19077

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_hash.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static zend_always_inline uint32_t zend_hash_check_size(uint32_t nSize)
119119
/* size should be between HT_MIN_SIZE and HT_MAX_SIZE */
120120
if (nSize <= HT_MIN_SIZE) {
121121
return HT_MIN_SIZE;
122-
} else if (UNEXPECTED(nSize >= HT_MAX_SIZE)) {
122+
} else if (UNEXPECTED(nSize > HT_MAX_SIZE)) {
123123
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket));
124124
}
125125

0 commit comments

Comments
 (0)