|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34203 PHP crashes on PDO prepared query
Submitted: 2005-08-21 10:33 UTC Modified: 2005-09-04 02:20 UTC
From: stotty at tvnet dot hu Assigned: wez (profile)
Status: Closed Package: PDO related
PHP Version: 5.1.0RC1 OS: Linux Fedora Core 4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: stotty at tvnet dot hu
New email:
PHP Version: OS:


 [2005-08-21 10:33 UTC] stotty at tvnet dot hu
If a prepared query with named parameters has one of the paramteres used more than once, then PHP fails with a realloc failure, without giving any useable error message.

This bug triggers only if called from within a class member function

Reproduce code:

  $dsn='pgsql:dbname=xenophile host=localhost port=5432 user=stoty';
  $dbc= new PDO($dsn);
  class Crashme {
 	public function crashfunction($one, $two) {
 		global $dbc;
   		(select total_cpu_weight from domain0 where id= :domain0_id) -
   		(select cpu_weight from domain_template where id= :template_id) -
   		as result 
   		from domain where domain0_id = :domain0_id");
    	$weight_check_stmt->bindParam(":domain0_id", $one);
   		$weight_check_stmt->bindParam(":template_id", $two);
  $crashclass = new Crashme;

Expected result:
I exepected to get a meaningfull error message, describing the problem, like I get when the above query is not run from a member function) (like in bug 33886)

Actual result:
I get this in the http error log:

FATAL:  erealloc():  Unable to allocate 4 bytes


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-04 02:20 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-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 19 15:03:37 2021 UTC