summaryrefslogtreecommitdiff
path: root/ext/interbase/ibase_query.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/interbase/ibase_query.c')
-rw-r--r--ext/interbase/ibase_query.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c
index 5f24ff84ec..37e895404f 100644
--- a/ext/interbase/ibase_query.c
+++ b/ext/interbase/ibase_query.c
@@ -1862,16 +1862,17 @@ PHP_FUNCTION(ibase_execute)
if (bind_n != expected_n) {
php_error_docref(NULL TSRMLS_CC, (bind_n < expected_n) ? E_WARNING : E_NOTICE,
"Statement expects %d arguments, %d given", expected_n, bind_n);
+
if (bind_n < expected_n) {
break;
}
+ }
- } else if (bind_n > 0) { /* have variables to bind */
- args = (zval ***) do_alloca(ZEND_NUM_ARGS() * sizeof(zval **), use_heap);
+ /* have variables to bind */
+ args = (zval ***) do_alloca((expected_n + 1) * sizeof(zval **), use_heap);
- if (FAILURE == zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args)) {
- break;
- }
+ if (FAILURE == zend_get_parameters_array_ex((expected_n + 1), args)) {
+ break;
}
/* Have we used this cursor before and it's still open (exec proc has no cursor) ? */