From: Dmitry Stogov Date: Thu, 22 Feb 2007 08:23:44 +0000 (+0000) Subject: Fixed possible crash in putenv() on win32 X-Git-Tag: RELEASE_1_0_1~185 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc39e75ac7f36f09b61c3ca3c0e0d418ca4067fe;p=php Fixed possible crash in putenv() on win32 --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 0fd0bae0aa..d60d8556a7 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -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