]> granicus.if.org Git - php/commitdiff
fix bug #63369
authorAntony Dovgal <tony2001@php.net>
Fri, 26 Oct 2012 12:36:47 +0000 (16:36 +0400)
committerAntony Dovgal <tony2001@php.net>
Fri, 26 Oct 2012 12:42:21 +0000 (16:42 +0400)
(un)serialize() leaves dangling pointers, causes crashes

ext/standard/basic_functions.c

index a30579e14352a9ca2429eb011d5e2052778411ba..d6377df84d682d65a5521d9ee81916ac0d223ffb 100644 (file)
@@ -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;