]> granicus.if.org Git - php/commitdiff
MFB: Fixed segfault in filter extension when using callbacks.
authorFelipe Pena <felipe@php.net>
Sun, 24 Feb 2008 18:41:08 +0000 (18:41 +0000)
committerFelipe Pena <felipe@php.net>
Sun, 24 Feb 2008 18:41:08 +0000 (18:41 +0000)
ext/filter/filter.c

index 16547a8534fc6bdbc68d7c7f2beef7d13f2eed29..1e3753316bf8db7d33f4a7053f692990f6cbaec4 100644 (file)
@@ -322,7 +322,7 @@ static void php_zval_filter(zval **value, long filter, long flags, zval *options
        filter_func.function(*value, flags, options, charset TSRMLS_CC);
 
        if (
-               options &&
+               options && (Z_TYPE_P(options) == IS_ARRAY || Z_TYPE_P(options) == IS_OBJECT) &&
                ((flags & FILTER_NULL_ON_FAILURE && Z_TYPE_PP(value) == IS_NULL) || 
                (!(flags & FILTER_NULL_ON_FAILURE) && Z_TYPE_PP(value) == IS_BOOL && Z_LVAL_PP(value) == 0)) &&
                zend_hash_exists(HASH_OF(options), "default", sizeof("default"))