From: Dmitry Stogov Date: Mon, 25 Dec 2006 13:11:48 +0000 (+0000) Subject: Fixed heap overflow X-Git-Tag: RELEASE_1_0_0RC1~521 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ed6591f8a51ab60601f4d821de8f417063694aa;p=php Fixed heap overflow --- diff --git a/main/streams/filter.c b/main/streams/filter.c index 4b414cbe27..306d11e1e1 100644 --- a/main/streams/filter.c +++ b/main/streams/filter.c @@ -323,7 +323,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';