|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42978 prepared statement bind mismatch causes zend_mm_heap corruption
Submitted: 2007-10-15 17:21 UTC Modified: 2007-11-20 14:23 UTC
From: ahawthorne at rook dot ca Assigned: iliaa (profile)
Status: Closed Package: PDO related
PHP Version: 5.2.4 OS: Fedora 6
Private report: No CVE-ID: None
 [2007-10-15 17:21 UTC] ahawthorne at rook dot ca
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);



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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-15 22:21 UTC] ahawthorne at rook dot ca
I compiled and installed the latest CVS snapshot but the problem still persists. The Same code returns the same error.
 [2007-11-20 14:23 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Dec 06 15:01:27 2023 UTC