]> granicus.if.org Git - php/commitdiff
check filter and class names for empty strings
authorAntony Dovgal <tony2001@php.net>
Wed, 11 Oct 2006 14:46:31 +0000 (14:46 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 11 Oct 2006 14:46:31 +0000 (14:46 +0000)
ext/standard/user_filters.c

index 4112354c78963a8faa99def46097cdb252cea67e..fe324972503699b62104332c9e3b685608a7ccac 100644 (file)
@@ -565,6 +565,16 @@ PHP_FUNCTION(stream_filter_register)
 
        RETVAL_FALSE;
 
+       if (!filtername_len) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filter name cannot be empty");
+               return;
+       }
+
+       if (!classname_len) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Class name cannot be empty");
+               return;
+       }
+
        if (!BG(user_filter_map)) {
                BG(user_filter_map) = (HashTable*) emalloc(sizeof(HashTable));
                zend_hash_init(BG(user_filter_map), 5, NULL, (dtor_func_t) filter_item_dtor, 0);