Permalink
Browse files

fix bug #63369

(un)serialize() leaves dangling pointers, causes crashes
  • Loading branch information...
1 parent 4f4d778 commit f2bffdc2e48174e38a059d425953e8b1c08dd4bf @tony2001 tony2001 committed Oct 26, 2012
Showing with 7 additions and 0 deletions.
  1. +2 −0 NEWS
  2. +5 −0 ext/standard/basic_functions.c
View
@@ -4,6 +4,8 @@ PHP NEWS
- Core:
. Fixed bug #63305 (zend_mm_heap corrupted with traits). (Dmitry, Laruence)
+ . Fixed bug #63369 ((un)serialize() leaves dangling pointers, causes crashes).
+ (Tony, Andrew Sitnikov)
- Curl:
. Fixed bug #63363 (Curl silently accepts boolean true for SSL_VERIFYHOST).
@@ -3684,6 +3684,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;

0 comments on commit f2bffdc

Please sign in to comment.