]> granicus.if.org Git - php/commitdiff
Fixed heap overflow
authorDmitry Stogov <dmitry@php.net>
Mon, 25 Dec 2006 13:11:23 +0000 (13:11 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 25 Dec 2006 13:11:23 +0000 (13:11 +0000)
main/streams/filter.c

index 657506c5c13ffb13f5fa08f759ffb6cb0923e9ed..ce35a226fe255304091a2f7b601a6ecf7e0d2784 100644 (file)
@@ -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';