]> granicus.if.org Git - php/commitdiff
need to call zend_is_callable() if callable is known to be invalid
authorAntony Dovgal <tony2001@php.net>
Tue, 30 May 2006 09:46:01 +0000 (09:46 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 30 May 2006 09:46:01 +0000 (09:46 +0000)
ext/pdo/pdo_stmt.c

index d40fe304f7a9c181196273b0f8f2ef2594d55bda..ef8abd6e65a5e3da5e9fd2d132d3a2777485f81a 100755 (executable)
@@ -651,7 +651,7 @@ static int do_fetch_class_prepare(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
 
 static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info * fci, zend_fcall_info_cache * fcc, int num_args TSRMLS_DC) /* {{{ */
 {
-       zval **object = NULL, **method;
+       zval **object = NULL, **method = NULL;
        zend_class_entry * ce = NULL, **pce;
        zend_function *function_handler;
        zstr lcname;
@@ -688,7 +688,7 @@ static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info *
                method = &callable;
        }
        
-       if (!zend_is_callable(callable, 0, NULL)) {
+       if (!method || !zend_is_callable(callable, 0, NULL)) {
                pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback" TSRMLS_CC);
                return 0;
        }