php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56512 Can't PDO object be serialized?
Submitted: 2005-08-26 20:30 UTC Modified: 2005-09-10 13:49 UTC
From: osmium at 163 dot com Assigned: wez (profile)
Status: Closed Package: PDO (PECL)
PHP Version: 5_1 CVS-2005-08-26 (dev) OS: Windows Server 2003
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: osmium at 163 dot com
New email:
PHP Version: OS:

 

 [2005-08-26 20:30 UTC] osmium at 163 dot com
Description:
------------
When using a PDO connection object unserialize from a serialized string, PHP crashed. Error message: "Application Failure  Apache.exe 2.0.54.0 in php5ts.dll 5.1.0.0 at offset 0012bb10".

Is it really a bug? My PHP version is 5.1.0RC1.

Reproduce code:
---------------
<?php
$connection = new PDO("mysql:dbname=test;host=localhost", "root", "root");
$connection = unserialize(serialize($connection));
$stmt = $connection->query("SELECT * FROM users");
$connection = null;
?>

Expected result:
----------------
The code worked well

Actual result:
--------------
The browser said "can not find server" and PHP crashed with message "Application Failure  Apache.exe 2.0.54.0 in php5ts.dll 5.1.0.0 at offset 0012bb10".

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-10 13:49 UTC] wez@php.net
PDO can't be serialized.  I've added some safety checks that will prevent the crash to the code in CVS.
Thanks for your report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 01:01:30 2024 UTC