Bug in zend_hash_init()
| From: | Anton Dobkin | Date: | Thu, 28 Apr 2011 10:53:06 +0000 |
| Subject: | Bug in zend_hash_init() | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-52054@lists.php.net to get a copy of this message | ||
Hi,
In function zend_hash_init() when allocate no persistent memory (if flag
persistent is 0) for arBuckets element of struct HashTable and virtual
memory is over, the function always returns SUCCESS
Code:
if (persistent) {
tmp = (Bucket **) calloc(ht->nTableSize, sizeof(Bucket *));
if (!tmp) {
return FAILURE;
}
ht->arBuckets = tmp;
} else {
// No checking on return value?
tmp = (Bucket **) ecalloc_rel(ht->nTableSize, sizeof(Bucket *));
if (tmp) {
ht->arBuckets = tmp;
}
}
Attachment: [text/x-patch] zend_hash_init.patch
Attachment: [text/x-patch] zend_hash_init.patch