From 01dee2c4b009d052f0fdfa07f35c181a1ac4aca0 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Fri, 26 Oct 2012 16:36:47 +0400 Subject: [PATCH] fix bug #63369 (un)serialize() leaves dangling pointers, causes crashes --- ext/standard/basic_functions.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index a30579e14352a..d6377df84d682 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -3732,6 +3732,11 @@ PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */ PHP_RINIT_FUNCTION(basic) /* {{{ */ { memset(BG(strtok_table), 0, 256); + + BG(serialize_lock) = 0; + memset(&BG(serialize), 0, sizeof(BG(serialize))); + memset(&BG(unserialize), 0, sizeof(BG(unserialize))); + BG(strtok_string) = NULL; BG(strtok_zval) = NULL; BG(strtok_last) = NULL;