Re: cvs: php-src(PHP_5_2) / NEWS /main SAPI.c /sapi/apache mod_php5.c

From: Date: Mon, 26 Jun 2006 09:02:02 +0000
Subject: Re: cvs: php-src(PHP_5_2) / NEWS /main SAPI.c /sapi/apache mod_php5.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-38904@lists.php.net to get a copy of this message
Rasmus Lerdorf wrote:
rasmus Wed May 10 21:19:32 2006 UTC
  Modified files:              (Branch: PHP_5_2)
    /php-src	NEWS     /php-src/main	SAPI.c     /php-src/sapi/apache	mod_php5.c   Log:
Add input_filter hook call in getenv()
http://cvs.php.net/viewcvs.cgi/php-src/main/SAPI.c?r1=1.202.2.7&r2=1.202.2.7.2.1&diff_format=u Index: php-src/main/SAPI.c diff -u php-src/main/SAPI.c:1.202.2.7 php-src/main/SAPI.c:1.202.2.7.2.1 --- php-src/main/SAPI.c:1.202.2.7 Sun Jan 1 12:50:17 2006 +++ php-src/main/SAPI.c Wed May 10 21:19:32 2006 @@ -18,13 +18,14 @@
    +----------------------------------------------------------------------+
*/ -/* $Id: SAPI.c,v 1.202.2.7 2006/01/01 12:50:17 sniper Exp $ */ +/* $Id: SAPI.c,v 1.202.2.7.2.1 2006/05/10 21:19:32 rasmus Exp $ */ #include <ctype.h> #include <sys/stat.h> #include "php.h" #include "SAPI.h" +#include "php_variables.h" #include "php_ini.h" #include "ext/standard/php_string.h" #include "ext/standard/pageinfo.h" @@ -914,11 +915,15 @@ SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC) { - if (sapi_module.getenv) { - return sapi_module.getenv(name, name_len TSRMLS_CC); + if (sapi_module.getenv) { + char *value, *tmp = sapi_module.getenv(name, name_len TSRMLS_CC); + if(tmp) value = estrdup(tmp); + else return NULL; + sapi_module.input_filter(PARSE_ENV, name, &value, strlen(value), NULL TSRMLS_CC); + return value;
Is this supposed to leak now?
} else { - return NULL; - } + return NULL; + } }
Regards, -- Michael

« previous php.cvs (#38904) next »