tony2001 Mon May 12 08:46:50 2008 UTC Modified files: /php-src/ext/standard basic_functions.c Log: revert patch that causes invalid reads/crashes on Linux http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.898&r2=1.899&diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.898 php-src/ext/standard/basic_functions.c:1.899 --- php-src/ext/standard/basic_functions.c:1.898 Tue May 6 18:04:25 2008 +++ php-src/ext/standard/basic_functions.c Mon May 12 08:46:49 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.898 2008/05/06 18:04:25 iliaa Exp $ */ +/* $Id: basic_functions.c,v 1.899 2008/05/12 08:46:49 tony2001 Exp $ */ #include "php.h" #include "php_streams.h" @@ -3822,7 +3822,9 @@ SetEnvironmentVariable(pe->key, "bugbug"); #endif putenv(pe->previous_value); +# if defined(PHP_WIN32) efree(pe->previous_value); +# endif } else { # if HAVE_UNSETENV unsetenv(pe->key); @@ -4386,8 +4388,12 @@ 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 */ - /* must copy previous value because putenv can free the string without notice */ +#if defined(PHP_WIN32) + /* must copy previous value because MSVCRT's putenv can free the string without notice */ pe.previous_value = estrdup(*env); +#else + pe.previous_value = *env; +#endif break; } }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php