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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 21 08:01:27 2024 UTC