iliaa Tue May 6 18:01:36 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/standard basic_functions.c Log: Fixed bug #44836 (putenv() crashes, avoid direct reference of environ in POSIX systems) # Original patch by delphij at FreeBSD dot org http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.64.2.31&r2=1.725.2.31.2.64.2.32&diff_format=u Index: php-src/ext/standard/basic_functions.c diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.31 php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.32 --- php-src/ext/standard/basic_functions.c:1.725.2.31.2.64.2.31 Mon May 5 11:28:11 2008 +++ php-src/ext/standard/basic_functions.c Tue May 6 18:01:32 2008 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.31 2008/05/05 11:28:11 tony2001 Exp $ */ +/* $Id: basic_functions.c,v 1.725.2.31.2.64.2.32 2008/05/06 18:01:32 iliaa Exp $ */ #include "php.h" #include "php_streams.h" @@ -3820,9 +3820,7 @@ 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); @@ -4427,12 +4425,8 @@ 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) - /* must copy previous value because MSVCRT's putenv can free the string without notice */ + /* must copy previous value because 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