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

index 4b414cbe274655f1837b15525634bcb9bf246ad9..306d11e1e1c267f7413365595214fadbd170b26c 100644 (file)
@@ -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';