mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
zend_hash_check_size: allow nSize <= HT_MAX_SIZE (#10244)
This is consistent with other uses of HT_MAX_SIZE
This commit is contained in:
@@ -119,7 +119,7 @@ static zend_always_inline uint32_t zend_hash_check_size(uint32_t nSize)
|
||||
/* size should be between HT_MIN_SIZE and HT_MAX_SIZE */
|
||||
if (nSize <= HT_MIN_SIZE) {
|
||||
return HT_MIN_SIZE;
|
||||
} else if (UNEXPECTED(nSize >= HT_MAX_SIZE)) {
|
||||
} else if (UNEXPECTED(nSize > HT_MAX_SIZE)) {
|
||||
zend_error_noreturn(E_ERROR, "Possible integer overflow in memory allocation (%u * %zu + %zu)", nSize, sizeof(Bucket), sizeof(Bucket));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user