]> granicus.if.org Git - php/commitdiff
Fixed possible crash in putenv() on win32
authorDmitry Stogov <dmitry@php.net>
Thu, 22 Feb 2007 08:23:44 +0000 (08:23 +0000)
committerDmitry Stogov <dmitry@php.net>
Thu, 22 Feb 2007 08:23:44 +0000 (08:23 +0000)
ext/standard/basic_functions.c

index 0fd0bae0aa7ff109e6143a20000e365d3d86d963..d60d8556a7488a41ee37cf6c6dbeb43eb6b5022e 100644 (file)
@@ -4431,7 +4431,7 @@ PHP_FUNCTION(putenv)
                        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 */
-                               pe.previous_value = estrndup(*env, 1024);
+                               pe.previous_value = estrdup(*env);
 #else
                                pe.previous_value = *env;
 #endif