summaryrefslogtreecommitdiff
path: root/xcache
diff options
context:
space:
mode:
authorXuefer <xuefer@gmail.com>2013-06-25 05:01:31 +0000
committerXuefer <xuefer@gmail.com>2013-06-25 05:01:31 +0000
commitdd6e9fbe859d9bfb45b87e5a4187e7c59a79cdc2 (patch)
tree094e968bff6e1bd55fe0329a02327363ba6d3188 /xcache
parentdb77416e0bba82795ed8f35cdafb42cfd4bbf3b6 (diff)
downloadxcache-dd6e9fbe859d9bfb45b87e5a4187e7c59a79cdc2.tar.gz
xcache-dd6e9fbe859d9bfb45b87e5a4187e7c59a79cdc2.zip
disassembler: fixes crash with nested sandbox (since 3.0)
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1275 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
Diffstat (limited to 'xcache')
-rw-r--r--xcache/xc_sandbox.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/xcache/xc_sandbox.c b/xcache/xc_sandbox.c
index 484b8f7..ff038a3 100644
--- a/xcache/xc_sandbox.c
+++ b/xcache/xc_sandbox.c
@@ -44,7 +44,7 @@ static void xc_free_zend_constant(zend_constant *c) /* {{{ */
/* }}} */
#endif
-typedef struct { /* sandbox {{{ */
+typedef struct _xc_sandbox_t { /* sandbox {{{ */
ZEND_24(NOTHING, const) char *filename;
HashTable orig_included_files;
@@ -76,6 +76,7 @@ typedef struct { /* sandbox {{{ */
#ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES
zend_uint orig_compiler_options;
#endif
+ struct _xc_sandbox_t *parent;
} xc_sandbox_t;
#undef TG
@@ -228,6 +229,7 @@ static xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, ZEND_24(NOTHING, con
CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_NO_CONSTANT_SUBSTITUTION | ZEND_COMPILE_DELAYED_BINDING;
#endif
+ sandbox->parent = XG(sandbox);
XG(sandbox) = (void *) sandbox;
XG(initial_compile_file_called) = 0;
return sandbox;
@@ -319,7 +321,7 @@ static void xc_sandbox_install(xc_sandbox_t *sandbox TSRMLS_DC) /* {{{ */
/* }}} */
static void xc_sandbox_free(xc_sandbox_t *sandbox, zend_op_array *op_array TSRMLS_DC) /* {{{ */
{
- XG(sandbox) = NULL;
+ XG(sandbox) = sandbox->parent;
#ifdef XCACHE_ERROR_CACHING
EG(user_error_handler_error_reporting) = sandbox->orig_user_error_handler_error_reporting;
#endif