com php-src: Fixed crash during search in empty persistent HashTable: ext/opcache/zend_persist.c
| From: | Dmitry Stogov | Date: | Tue, 28 May 2013 19:45:36 +0000 |
| Subject: | com php-src: Fixed crash during search in empty persistent HashTable: ext/opcache/zend_persist.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72247@lists.php.net to get a copy of this message | ||
Commit: 6008ac8e321e4141d78abff82b7fba74e41bac1b
Author: Dmitry Stogov <dmitry@zend.com> Tue, 28 May 2013 23:45:36 +0400
Parents: 2f01e06786c6f4b2479fdb728bd26062d07208e0
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6008ac8e321e4141d78abff82b7fba74e41bac1b
Log:
Fixed crash during search in empty persistent HashTable
Changed paths:
M ext/opcache/zend_persist.c
Diff:
diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c
index 0bffae4..9f1940e 100644
--- a/ext/opcache/zend_persist.c
+++ b/ext/opcache/zend_persist.c
@@ -52,6 +52,10 @@ typedef void (*zend_persist_func_t)(void * TSRMLS_DC);
static void zend_persist_zval_ptr(zval **zp TSRMLS_DC);
+#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
+static const Bucket *uninitialized_bucket = NULL;
+#endif
+
static void zend_hash_persist(HashTable *ht, void (*pPersistElement)(void *pElement TSRMLS_DC),
size_t el_size TSRMLS_DC)
{
Bucket *p = ht->pListHead;
@@ -129,7 +133,7 @@ static void zend_hash_persist(HashTable *ht, void (*pPersistElement)(void *pElem
zend_accel_store(ht->arBuckets, sizeof(Bucket*) * ht->nTableSize);
#if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
} else {
- ht->arBuckets = NULL;
+ ht->arBuckets = (Bucket**)&uninitialized_bucket;
}
#endif
}