summaryrefslogtreecommitdiff
path: root/processor
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2014-05-30 14:18:59 +0000
committerXuefer <xuefer@gmail.com>2014-05-30 14:18:59 +0000
commitb51efc28594d65cc32e9eb462e01725751302443 (patch)
treefa82602b7cc088a7adb3beee321271e339dfb5d0 /processor
parentcaf19fe783f8c15c22bbe93be4fb101e6f8abf3a (diff)
downloadxcache-b51efc28594d65cc32e9eb462e01725751302443.tar.gz
xcache-b51efc28594d65cc32e9eb462e01725751302443.zip
fix segv for empty hash table on <=PHP_5_3
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1494 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'processor')
-rw-r--r--processor/hashtable.m46
1 files changed, 4 insertions, 2 deletions
diff --git a/processor/hashtable.m4 b/processor/hashtable.m4
index 9df3835..2617fec 100644
--- a/processor/hashtable.m4
+++ b/processor/hashtable.m4
@@ -168,8 +168,10 @@ define(`DEF_HASH_TABLE_FUNC', `DEF_STRUCT_P_FUNC(`HashTable', `$1', `
}
}
')
- RELOCATE(Bucket, pListHead)
- RELOCATE(Bucket, pListTail)
+ if (SRC(`nNumOfElements')) {
+ RELOCATE(Bucket, pListHead)
+ RELOCATE(Bucket, pListTail)
+ }
RELOCATE(Bucket *, arBuckets)
#ifdef ZEND_ENGINE_2_4
}