cvs: ZendEngine2 / zend_hash.c
| From: | Matt Wilmas | Date: | Fri, 30 May 2008 11:05:36 +0000 |
| Subject: | cvs: ZendEngine2 / zend_hash.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-6760@lists.php.net to get a copy of this message | ||
mattwil Fri May 30 11:05:36 2008 UTC
Modified files:
/ZendEngine2 zend_hash.c
Log:
Fixed memcmp() check with hash_quick_del (realKeyLength would be 0)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_hash.c?r1=1.154&r2=1.155&diff_format=u
Index: ZendEngine2/zend_hash.c
diff -u ZendEngine2/zend_hash.c:1.154 ZendEngine2/zend_hash.c:1.155
--- ZendEngine2/zend_hash.c:1.154 Tue Jan 15 09:35:50 2008
+++ ZendEngine2/zend_hash.c Fri May 30 11:05:35 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_hash.c,v 1.154 2008/01/15 09:35:50 tony2001 Exp $ */
+/* $Id: zend_hash.c,v 1.155 2008/05/30 11:05:35 mattwil Exp $ */
#include "zend.h"
#include "zend_operators.h"
@@ -622,13 +622,11 @@
uint nIndex;
Bucket *p;
void *tmp = NULL;
- uint realKeyLength = 0;
IS_CONSISTENT(ht);
if (flag == HASH_DEL_KEY) {
UNICODE_KEY(ht, type, arKey, nKeyLength, tmp);
- realKeyLength = USTR_BYTES(type, nKeyLength);
h = zend_u_inline_hash_func(type, arKey, nKeyLength);
}
nIndex = h & ht->nTableMask;
@@ -639,7 +637,7 @@
&& (p->nKeyLength == nKeyLength)
&& ((p->nKeyLength == 0) /* Numeric index (short circuits the memcmp()) */
|| ((p->key.type == type)
- && !memcmp(p->key.arKey.s, arKey.s, realKeyLength)))) {
+ && !memcmp(p->key.arKey.s, arKey.s, USTR_BYTES(type, nKeyLength))))) {
HANDLE_BLOCK_INTERRUPTIONS();
if (p == ht->arBuckets[nIndex]) {
ht->arBuckets[nIndex] = p->pNext;