Skip to content

Commit 4cc0286

Browse files
committed
Fix #73832 - leave the table in a safe state if the size is too big.
1 parent 8d2539f commit 4cc0286

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: Zend/zend_hash.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,14 @@ ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_
175175
GC_REFCOUNT(ht) = 1;
176176
GC_TYPE_INFO(ht) = IS_ARRAY;
177177
ht->u.flags = (persistent ? HASH_FLAG_PERSISTENT : 0) | HASH_FLAG_APPLY_PROTECTION | HASH_FLAG_STATIC_KEYS;
178-
ht->nTableSize = zend_hash_check_size(nSize);
179178
ht->nTableMask = HT_MIN_MASK;
180179
HT_SET_DATA_ADDR(ht, &uninitialized_bucket);
181180
ht->nNumUsed = 0;
182181
ht->nNumOfElements = 0;
183182
ht->nInternalPointer = HT_INVALID_IDX;
184183
ht->nNextFreeElement = 0;
185184
ht->pDestructor = pDestructor;
185+
ht->nTableSize = zend_hash_check_size(nSize);
186186
}
187187

188188
static void ZEND_FASTCALL zend_hash_packed_grow(HashTable *ht)

0 commit comments

Comments
 (0)