php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26001 Attempt to serialize causes php crash
Submitted: 2003-10-27 07:42 UTC Modified: 2003-11-28 10:42 UTC
From: david dot nicholls at camden dot gov dot uk Assigned: wez (profile)
Status: Closed Package: COM related
PHP Version: 5CVS-2003-10-27 (dev) OS: Windows 2000
Private report: No CVE-ID: None
 [2003-10-27 07:42 UTC] david dot nicholls at camden dot gov dot uk
Description:
------------
Get a Dr Watson crash when I attempt to serialize the data in the PasswordExpirationDate property from a WinNT:// call.

Visually the data is '02/11/2003 15:17:01'
the above text string does not cause a crash when serialized

Other returned properties can be serialized and code runs fine when the PasswordExpirationDate property is not serialized

Reproduce code:
---------------
Requires an NT 4 domain controller to test against (con provide code if required)

Actual result:
--------------
Dr Waston crashdump report available on request (not a small file) however following line seem pertinant

*----> Stack Back Trace <----*

FramePtr ReturnAd Param#1  Param#2  Param#3  Param#4  Function Name
0012FA9C 0000000E 0000004E 00000010 0000000F 00000001 !zend_stack_base 

FramePtr ReturnAd Param#1  Param#2  Param#3  Param#4  Function Name
0145FF40 100C1A95 0145FF64 00000000 00000000 00000000 user32!GetMenuItemRect 
0145FFB4 7C57B382 01136C88 00000000 00000000 01136C88 !zend_timeout 
0145FFEC 00000000 78008532 01136C88 00000000 2B4D4F43 kernel32!lstrcmpiW 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-27 10:50 UTC] wez@php.net
I probably won't be able to take a look at this for a couple of days, but could you try the following code and
see if it crashes too?

$v = new variant('02/11/2003 15:17:01', VT_DATE);
$s = serialize($v);

As a possible workaround, cast that property to a string
before assigning it to whatever you are serializing:

$data['expires'] = (string)$com->PasswordExpirationDate;
serialize($data);
 [2003-10-27 11:05 UTC] david dot nicholls at camden dot gov dot uk
The variant code crashes and the work around works :)

Many thanks again
 [2003-11-28 10:42 UTC] wez@php.net
Crash fixed; serialization of COM objects not yet implemented (requires some internal php magic).
Keep on casting to string for now :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 09:01:32 2024 UTC