svn: /php/php-src/trunk/ext/mysqli/ mysqli_api.c tests/bug48909.phpt
| From: | Andrey Hristov | Date: | Fri, 18 Sep 2009 14:32:01 +0000 |
| Subject: | svn: /php/php-src/trunk/ext/mysqli/ mysqli_api.c tests/bug48909.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-60425@lists.php.net to get a copy of this message | ||
andrey Fri, 18 Sep 2009 14:32:01 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=288438
Log:
Fix for bug#48909 Segmentation fault in mysqli_stmt_execute
Bug: http://bugs.php.net/48909 (Feedback) Segmentation fault
in mysqli_stmt_execute
Changed paths:
U php/php-src/trunk/ext/mysqli/mysqli_api.c
A php/php-src/trunk/ext/mysqli/tests/bug48909.phpt
Modified: php/php-src/trunk/ext/mysqli/mysqli_api.c
===================================================================
--- php/php-src/trunk/ext/mysqli/mysqli_api.c 2009-09-18 10:49:31 UTC (rev 288437)
+++ php/php-src/trunk/ext/mysqli/mysqli_api.c 2009-09-18 14:32:01 UTC (rev 288438)
@@ -741,7 +741,7 @@
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;
}
Added: php/php-src/trunk/ext/mysqli/tests/bug48909.phpt
===================================================================
--- php/php-src/trunk/ext/mysqli/tests/bug48909.phpt (rev 0)
+++ php/php-src/trunk/ext/mysqli/tests/bug48909.phpt 2009-09-18 14:32:01 UTC (rev 288438)
@@ -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