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

index 8d6f45005a81af12e8ca99a82908dd346f48eaa5..94a49d78a03d646a0ab8cac2691bb7c557a507ff 100644 (file)
@@ -4446,7 +4446,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