summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2012-04-05 13:37:21 +0000
committerXuefer <xuefer@gmail.com>2012-04-05 13:37:21 +0000
commit9b3c12bd3d313964f2cd602377d698e25674fbce (patch)
tree0dce48f4eeb31ec2cad495943705d91766c86055
parentcf1dc6aaad971e9cdf4168a0fa0aa1f3ad1b1595 (diff)
downloadxcache-1.3.tar.gz
xcache-1.3.zip
merge some changes from trunk1.3
git-svn-id: svn://svn.lighttpd.net/xcache/branches/1.3@886 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
-rw-r--r--ChangeLog4
-rw-r--r--NEWS4
-rw-r--r--processor/processor.m46
-rw-r--r--processor/string.m410
-rw-r--r--xcache-test.ini1
-rw-r--r--xcache.h4
6 files changed, 18 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 89ad4f8..61705d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+1.3.3 2012-?-?
+========
+ * fix constant name handling (possible SIGSEGV)
+
1.3.2 2011-06-04
========
* avoid possible filename injection in admin page
diff --git a/NEWS b/NEWS
index 325a158..7bd7337 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+1.3.3 2012-?-?
+========
+ * stability fix for PHP_5_3 and before
+
1.3.2 2011-06-04
========
* admin page security fix
diff --git a/processor/processor.m4 b/processor/processor.m4
index 79dbb4a..db052a5 100644
--- a/processor/processor.m4
+++ b/processor/processor.m4
@@ -240,11 +240,9 @@ DEF_STRUCT_P_FUNC(`zend_constant', , `dnl {{{
STRUCT(zval, value)
DISPATCH(int, flags)
DISPATCH(uint, name_len)
- pushdef(`emalloc', `malloc($1)')
- pushdef(`ecalloc', `calloc($1, $2)')
+ pushdef(`estrndup', `zend_strndup')
PROC_ZSTRING_N(, name, name_len)
- popdef(`ecalloc')
- popdef(`emalloc')
+ popdef(`estrndup')
DISPATCH(int, module_number)
')
dnl }}}
diff --git a/processor/string.m4 b/processor/string.m4
index 59a422a..00b15a7 100644
--- a/processor/string.m4
+++ b/processor/string.m4
@@ -20,9 +20,9 @@ define(`PROC_STRING_N_EX', `
STRTYPE, `zstr_uchar', `ZSTR_U($1)',
STRTYPE, `zstr_char', `ZSTR_S($1)',
`', `', `$1'))
- pushdef(`U', ifelse(
- PTRTYPE, `char', `',
- PTRTYPE, `UChar', `u'))
+ pushdef(`STRDUP', ifelse(
+ PTRTYPE, `char', `estrndup',
+ PTRTYPE, `UChar', `eustrndup'))
if (SRCPTR == NULL) {
IFNOTMEMCPY(`IFCOPY(`
DSTPTR = NULL;
@@ -61,7 +61,7 @@ define(`PROC_STRING_N_EX', `
IFCALC(`xc_calc_string_n(processor, ISTYPE, ZSTR(SRCSTR), $3 C_RELAYLINE);')
IFSTORE(`DSTPTR = ifelse(PTRTYPE,`char',`ZSTR_S',`ZSTR_U')(xc_store_string_n(processor, ISTYPE, ZSTR(SRCSTR), $3 C_RELAYLINE));')
IFRESTORE(`
- DSTPTR = e`'U`'strndup(SRCPTR, ($3) - 1);
+ DSTPTR = STRDUP() (SRCPTR, ($3) - 1);
')
FIXPOINTER_EX(`PTRTYPE', DSTPTR)
IFDASM(`
@@ -76,7 +76,7 @@ define(`PROC_STRING_N_EX', `
')
')
}
- popdef(`U')
+ popdef(`STRDUP')
popdef(`DSTPTR')
popdef(`SRCPTR')
popdef(`SRCSTR')
diff --git a/xcache-test.ini b/xcache-test.ini
index b765ac4..f04dc1d 100644
--- a/xcache-test.ini
+++ b/xcache-test.ini
@@ -1,4 +1,5 @@
memory_limit = 256M
+error_reporting = E_ALL|E_STRICT
[xcache]
zend_extension_debug_ts=./modules/xcache.so
diff --git a/xcache.h b/xcache.h
index d292ee6..6db3df0 100644
--- a/xcache.h
+++ b/xcache.h
@@ -3,7 +3,7 @@
#define XCACHE_NAME "XCache"
#define XCACHE_VERSION "1.3.3-dev"
#define XCACHE_AUTHOR "mOo"
-#define XCACHE_COPYRIGHT "Copyright (c) 2005-2011"
+#define XCACHE_COPYRIGHT "Copyright (c) 2005-2012"
#define XCACHE_URL "http://xcache.lighttpd.net"
#define XCACHE_WIKI_URL XCACHE_URL "/wiki"
@@ -21,7 +21,7 @@
#include "lock.h"
#define HAVE_INODE
-#if !defined(ZEND_ENGINE_2_4) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 && PHP_RELEASE_VERSION >= 99 || PHP_MAJOR_VERSION > 5)
+#if !defined(ZEND_ENGINE_2_4) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4 || PHP_MAJOR_VERSION > 5)
# define ZEND_ENGINE_2_4
#endif
#if !defined(ZEND_ENGINE_2_3) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 3 || defined(ZEND_ENGINE_2_4))