--- embedaddon/php/ext/standard/basic_functions.c 2012/05/29 12:34:43 1.1.1.2 +++ embedaddon/php/ext/standard/basic_functions.c 2013/07/22 01:32:04 1.1.1.3 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2012 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.1.1.2 2012/05/29 12:34:43 misho Exp $ */ +/* $Id: basic_functions.c,v 1.1.1.3 2013/07/22 01:32:04 misho Exp $ */ #include "php.h" #include "php_streams.h" @@ -3408,7 +3408,7 @@ static void php_putenv_destructor(putenv_entry *pe) /* SetEnvironmentVariable(pe->key, "bugbug"); #endif putenv(pe->previous_value); -# if defined(PHP_WIN32) || __FreeBSD_version < 700050 +# if defined(PHP_WIN32) efree(pe->previous_value); # endif } else { @@ -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; @@ -3719,8 +3724,6 @@ PHP_RINIT_FUNCTION(basic) /* {{{ */ /* Default to global filters only */ FG(stream_filters) = NULL; - FG(wrapper_errors) = NULL; - return SUCCESS; } /* }}} */ @@ -3833,7 +3836,7 @@ PHP_NAMED_FUNCTION(php_inet_ntop) } if (!inet_ntop(af, address, buffer, sizeof(buffer))) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occured"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred"); RETURN_FALSE; } @@ -4059,7 +4062,7 @@ PHP_FUNCTION(putenv) pe.previous_value = NULL; for (env = environ; env != NULL && *env != NULL; env++) { if (!strncmp(*env, pe.key, pe.key_len) && (*env)[pe.key_len] == '=') { /* found it */ -#if defined(PHP_WIN32) || __FreeBSD_version < 700050 +#if defined(PHP_WIN32) /* must copy previous value because MSVCRT's putenv can free the string without notice */ pe.previous_value = estrdup(*env); #else @@ -5045,8 +5048,11 @@ void php_free_shutdown_functions(TSRMLS_D) /* {{{ */ zend_hash_destroy(BG(user_shutdown_function_names)); FREE_HASHTABLE(BG(user_shutdown_function_names)); BG(user_shutdown_function_names) = NULL; - } - zend_end_try(); + } zend_catch { + /* maybe shutdown method call exit, we just ignore it */ + FREE_HASHTABLE(BG(user_shutdown_function_names)); + BG(user_shutdown_function_names) = NULL; + } zend_end_try(); } /* }}} */