From: Dmitry Stogov Date: Thu, 22 Feb 2007 08:23:17 +0000 (+0000) Subject: Fixed possible crash in putenv() on win32 X-Git-Tag: php-5.2.2RC1~323 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f027aef074cbf7d188a3631fe5e9f8c4d0dba2de;p=php Fixed possible crash in putenv() on win32 --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 8d6f45005a..94a49d78a0 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -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