for (i = 0; i < stmt->param.var_cnt; i++) {
for (j = i + 1; j < stmt->param.var_cnt; j++) {
/* Oops, someone binding the same variable - clone */
- if (stmt->param.vars[j] == stmt->param.vars[i]) {
+ if (stmt->param.vars[j] == stmt->param.vars[i] && stmt->param.vars[i]) {
php_mysqli_stmt_copy_it(&copies, stmt->param.vars[i], stmt->param.var_cnt, i);
break;
}
--- /dev/null
+--TEST--
+Bug #48909 (Segmentation fault in mysqli_stmt_execute)
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once('skipifconnectfailure.inc');
+?>
+--FILE--
+<?php
+ include "connect.inc";
+
+ include "table.inc";
+
+ $stmt = $link->prepare("insert into test values (?,?)");
+ var_dump($stmt->bind_param("bb",$bvar,$bvar));
+ var_dump($stmt->execute());
+ $stmt->close();
+ $link->close();
+ echo "done";
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+done