From: Dmitry Stogov Date: Mon, 25 Dec 2006 13:11:23 +0000 (+0000) Subject: Fixed heap overflow X-Git-Tag: php-5.2.1RC2~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5436160dc625a256a1d9b5ab3e608039a4d96f20;p=php Fixed heap overflow --- diff --git a/main/streams/filter.c b/main/streams/filter.c index 657506c5c1..ce35a226fe 100644 --- a/main/streams/filter.c +++ b/main/streams/filter.c @@ -265,7 +265,8 @@ PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval /* try a wildcard */ char *wildname; - wildname = estrdup(filtername); + wildname = emalloc(n+3); + memcpy(wildname, filtername, n+1); period = wildname + (period - filtername); while (period && !filter) { *period = '\0';