diff options
author | Dmitry Stogov <dmitry@zend.com> | 2013-05-28 23:45:36 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2013-05-28 23:45:36 +0400 |
commit | 6008ac8e321e4141d78abff82b7fba74e41bac1b (patch) | |
tree | dbe894f58f7eeb621b84170cc3f1d16bebbefced /ext/opcache | |
parent | 2f01e06786c6f4b2479fdb728bd26062d07208e0 (diff) | |
download | php-git-6008ac8e321e4141d78abff82b7fba74e41bac1b.tar.gz |
Fixed crash during search in empty persistent HashTable
Diffstat (limited to 'ext/opcache')
-rw-r--r-- | ext/opcache/zend_persist.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index 0bffae4d0e..9f1940e061 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 } |