MFH:Fix for bug#48909 Segmentation fault in mysqli_stmt_execute

This commit is contained in:
Andrey Hristov 2009-09-18 14:33:08 +00:00
parent 8aae3baa45
commit 967239727e
3 changed files with 26 additions and 1 deletions

1
NEWS
View File

@ -118,6 +118,7 @@ PHP NEWS
(naf at altlinux dot ru, Felipe)
- Fixed bug #48912 (Namespace causes unexpected strict behaviour with
extract()). (Dmitry)
- Fixed bug #48909 (Segmentation fault in mysqli_stmt_execute()).
- Fixed bug #48899 (is_callable returns true even if method does not exist in
parent class). (Felipe)
- Fixed bug #48893 (Problems compiling with Curl). (Felipe)

View File

@ -735,7 +735,7 @@ PHP_FUNCTION(mysqli_stmt_execute)
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;
}

View File

@ -0,0 +1,24 @@
--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