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

index 83c111a34cd8e1c7888dcb161d35d3880dfeeac3..adaf6b419a4b668641155d811ed86d8e545ed08a 100644 (file)
@@ -549,6 +549,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);