diff options
| author | Felipe Pena <felipe@php.net> | 2008-10-07 18:18:45 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2008-10-07 18:18:45 +0000 |
| commit | e8f25c5b98fffa1bb4fd038ebba8da51a0abc541 (patch) | |
| tree | a317a0380d3dcbe193bf49d35b903f462b20703e /ext/interbase/ibase_events.c | |
| parent | d0ad1517f5e5d4e099681e3837cb71187915a549 (diff) | |
| download | php-git-e8f25c5b98fffa1bb4fd038ebba8da51a0abc541.tar.gz | |
- MFH: Fixed bug #45575 (Segfault with invalid non-string as event handler callback)
patch by Christian seiler
Diffstat (limited to 'ext/interbase/ibase_events.c')
| -rw-r--r-- | ext/interbase/ibase_events.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/interbase/ibase_events.c b/ext/interbase/ibase_events.c index b0f5763d92..09cf99ef8c 100644 --- a/ext/interbase/ibase_events.c +++ b/ext/interbase/ibase_events.c @@ -260,7 +260,7 @@ PHP_FUNCTION(ibase_set_event_handler) * link resource id (int) as arguments. The value returned from the function is * used to determine if the event handler should remain set. */ - + char *cb_name; zval **args[17], **cb_arg; ibase_db_link *ib_link; ibase_event *event; @@ -312,11 +312,12 @@ PHP_FUNCTION(ibase_set_event_handler) } /* get the callback */ - if (!zend_is_callable(*cb_arg, 0, NULL TSRMLS_CC)) { - _php_ibase_module_error("Callback argument %s is not a callable function" - TSRMLS_CC, Z_STRVAL_PP(cb_arg)); + if (!zend_is_callable(*cb_arg, 0, &cb_name TSRMLS_CC)) { + _php_ibase_module_error("Callback argument %s is not a callable function" TSRMLS_CC, cb_name); + efree(cb_name); RETURN_FALSE; } + efree(cb_name); /* allocate the event resource */ event = (ibase_event *) safe_emalloc(sizeof(ibase_event), 1, 0); |
