zend_hash.c fishy code
| From: | Stefan Esser | Date: | Sun, 29 Jan 2006 21:01:20 +0000 |
| Subject: | zend_hash.c fishy code | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-21726@lists.php.net to get a copy of this message | ||
Good Morning,
I wonder If I am completely missing the point, but the following piece
of code seems fishy to me:
ZEND_API int zend_hash_del_key_or_index(HashTable *ht, char *arKey, uint
nKeyLength, ulong h, int flag)
{
uint nIndex;
Bucket *p;
...
while (p != NULL) {
if ((p->h == h) && ((p->nKeyLength == 0) || /* Numeric
index */
((p->nKeyLength == nKeyLength) &&
(!memcmp(p->arKey, arKey, nKeyLength))))) {
HANDLE_BLOCK_INTERRUPTIONS();
...
If I am not completely mistaken this means: If this is a bucket with a
numeric index with the hash value of the key we want to delete, then
delete it, even when we wanted to delete a key with a string as index.
Stefan