From: Jouni Ahto Date: Sun, 21 May 2000 21:13:32 +0000 (+0000) Subject: Fix #4230. Putenv() was modifying its argument, a no-no. X-Git-Tag: php-4.0.0~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e80b2b13fa3ff9c72ac19cc84702e0fd923c3530;p=php Fix #4230. Putenv() was modifying its argument, a no-no. --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index cdbc5bbccb..4a1aa32a0d 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -824,12 +824,11 @@ PHP_FUNCTION(putenv) PLS_FETCH(); pe.putenv_string = estrndup((*str)->value.str.val,(*str)->value.str.len); - pe.key = (*str)->value.str.val; + pe.key = estrndup((*str)->value.str.val, (*str)->value.str.len); if ((p=strchr(pe.key,'='))) { /* nullify the '=' if there is one */ *p='\0'; } pe.key_len = strlen(pe.key); - pe.key = estrndup(pe.key,pe.key_len); if (PG(safe_mode)) { /* Check the protected list */