1
0
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:
Dmitry Stogov
2011-04-15 09:59:42 +00:00
parent e623543452
commit 8fe3ea75cb

View File

@@ -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)