File php-5.1.2-zend_hash_del.patch of Package php

--- Zend/zend_hash.c	2006/01/04 23:53:04	1.121.2.1
+++ Zend/zend_hash.c	2006/02/06 20:37:11	1.121.2.3
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_hash.c,v 1.121.2.1 2006/01/04 23:53:04 andi Exp $ */
+/* $Id: zend_hash.c,v 1.121.2.3 2006/02/06 20:37:11 tony2001 Exp $ */
 
 #include "zend.h"
 
@@ -461,8 +461,10 @@
 
 	p = ht->arBuckets[nIndex];
 	while (p != NULL) {
-		if ((p->h == h) && ((p->nKeyLength == 0) || /* Numeric index */
-			((p->nKeyLength == nKeyLength) && (!memcmp(p->arKey, arKey, nKeyLength))))) {
+		if ((p->h == h) 
+			 && (p->nKeyLength == nKeyLength)
+			 && ((p->nKeyLength == 0) /* Numeric index (short circuits the memcmp() check) */
+				 || !memcmp(p->arKey, arKey, nKeyLength))) { /* String index */
 			HANDLE_BLOCK_INTERRUPTIONS();
 			if (p == ht->arBuckets[nIndex]) {
 				ht->arBuckets[nIndex] = p->pNext;
@@ -1259,7 +1261,7 @@
 
 ZEND_API int zend_hash_compare(HashTable *ht1, HashTable *ht2, compare_func_t compar, zend_bool ordered TSRMLS_DC)
 {
-	Bucket *p1, *p2;
+	Bucket *p1, *p2 = NULL;
 	int result;
 	void *pData2;
 
openSUSE Build Service is sponsored by