#42978 [Fbk->Opn]: prepared statement bind mismatch causes zend_mm_heap corruption
| From: | ahawthorne at rook dot ca | Date: | Mon, 15 Oct 2007 22:21:33 +0000 |
| Subject: | #42978 [Fbk->Opn]: prepared statement bind mismatch causes zend_mm_heap corruption | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-118576@lists.php.net to get a copy of this message | ||
ID: 42978
User updated by: ahawthorne at rook dot ca
Reported By: ahawthorne at rook dot ca
-Status: Feedback
+Status: Open
Bug Type: PDO related
Operating System: Fedora 6
PHP Version: 5.2.4
New Comment:
I compiled and installed the latest CVS snapshot but the problem still
persists. The Same code returns the same error.
Previous Comments:
------------------------------------------------------------------------
[2007-10-15 19:35:27] johannes@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
------------------------------------------------------------------------
[2007-10-15 17:21:25] ahawthorne at rook dot ca
Description:
------------
Having a prepared statement with a given number of parameters (ie. ?,?)
and binding two more parameters than required causes zend_mm_heap
corruption where an error is expected.
Reproduce code:
---------------
// NOTE: I'm running PostgreSQL 8.2.3
$db = new e4_PDO($db_connect_string);
$item = array(112,113,114);
$sql = "SELECT * FROM item_table WHERE item_id IN (?)";
$stmt = $db->prepare($sql);
$stmt->bindValue(1,$item[0]);
$stmt->bindValue(2,$item[1]);
$stmt->bindValue(3,$item[2]);
$stmt->execute();
Expected result:
----------------
something like:
ERROR: bind message supplies 3 parameters, but prepared statement
"pdo_pgsql_stmt_XXXXXXXX" requires 1
Actual result:
--------------
zend_mm_heap corrupted
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42978&edit=1