andrey                                   Fri, 18 Sep 2009 14:33:08 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=288439

Log:
MFH: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/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c
    A   php/php-src/branches/PHP_5_3/ext/mysqli/tests/bug48909.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2009-09-18 14:32:01 UTC (rev 288438)
+++ php/php-src/branches/PHP_5_3/NEWS   2009-09-18 14:33:08 UTC (rev 288439)
@@ -118,6 +118,7 @@
   (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)

Modified: php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c        2009-09-18 
14:32:01 UTC (rev 288438)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/mysqli_api.c        2009-09-18 
14:33:08 UTC (rev 288439)
@@ -735,7 +735,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/branches/PHP_5_3/ext/mysqli/tests/bug48909.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqli/tests/bug48909.phpt                 
        (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/bug48909.phpt 2009-09-18 
14:33:08 UTC (rev 288439)
@@ -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

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to