mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
MFH:Fix for bug#48909 Segmentation fault in mysqli_stmt_execute
This commit is contained in:
parent
8aae3baa45
commit
967239727e
1
NEWS
1
NEWS
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
24
ext/mysqli/tests/bug48909.phpt
Normal file
24
ext/mysqli/tests/bug48909.phpt
Normal 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
|
Loading…
Reference in New Issue
Block a user