PDO Exception Causes PHP Crash
| Bug #38168 | PDO Exception Causes PHP Crash | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2006-07-20 21:35 UTC | Modified: | 2006-08-01 16:37 UTC |
|
||||||||||
| From: | php at unfit dot org | Assigned: | ||||||||||||
| Status: | Closed | Package: | PDO related | |||||||||||
| PHP Version: | 5.1.4 | OS: | Gentoo Linux | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2006-07-20 21:35 UTC] php at unfit dot org
Description:
------------
Core dump on PDO error.
PDO error code if checked before execute is 'HY093'.
Reproduce code:
---------------
<?php
//use actual database, user and password where applicable
$dbh = new PDO('pgsql:host=127.0.0.1;dbname=foo', 'foo', 'foo');
$query = $dbh->prepare('INSERT INTO table (varA, varB, varC) VALUES ( :varA, :varB, :varC );');
$query->bindValue(':foo', 'foo');
$query->bindValue(':varC', 'foo');
$err = $query->errorCode();
echo "$err\n";
echo "you will see this.\n"; flush();
$query->execute();
/*
CRASH POINT
You will see only output that has been flushed.
If running on the command line you will also see something like this:
*** glibc detected *** malloc(): memory corruption: 0x16987018 ***
Aborted (core dumped)
*/
echo "you won't see this.\n"; flush();
?>
Expected result:
----------------
HY093
you will see this.
you won't see this.
Actual result:
--------------
HY093
you will see this.
*** glibc detected *** malloc(): memory corruption: 0x16987018 ***
Aborted (core dumped)
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2006-07-23 17:42 UTC] php at unfit dot org
[2006-07-23 17:43 UTC] php at unfit dot org
[2006-07-24 16:20 UTC] php at unfit dot org
[2006-07-24 16:40 UTC] tony2001@php.net
[2006-08-01 16:37 UTC] iliaa@php.net