From:             ahawthorne at rook dot ca
Operating system: Fedora 6
PHP version:      5.2.4
PHP Bug Type:     PDO related
Bug description:  prepared statement bind mismatch causes zend_mm_heap 
corruption

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 bug report at http://bugs.php.net/?id=42978&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=42978&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=42978&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=42978&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=42978&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=42978&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=42978&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=42978&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=42978&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=42978&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=42978&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=42978&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=42978&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=42978&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=42978&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=42978&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=42978&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=42978&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=42978&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=42978&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=42978&r=mysqlcfg

Reply via email to