mirror of
https://github.com/php/php-src.git
synced 2026-04-18 21:41:22 +02:00
Changed initialization order to workaround against crashes after memory overflow
This commit is contained in:
@@ -138,8 +138,8 @@ ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength)
|
||||
|
||||
#define CHECK_INIT(ht) do { \
|
||||
if (UNEXPECTED((ht)->nTableMask == 0)) { \
|
||||
(ht)->nTableMask = (ht)->nTableSize - 1; \
|
||||
(ht)->arBuckets = (Bucket **) pecalloc((ht)->nTableSize, sizeof(Bucket *), (ht)->persistent); \
|
||||
(ht)->nTableMask = (ht)->nTableSize - 1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user