From: kasper at webmasteren dot eu
Operating system: windows, linux
PHP version: Irrelevant
Package: Reproducible crash
Bug Type: Bug
Bug description:Unserialize Invalid Date causes crash
Description:
------------
Core PHP,every version so far, 5.3.* and 5.4.*
When unserializing this string :
O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07
03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}
created from: Datetime:createFromFormat("99-99-9999","j-n-Y");
then serialized, to a file. Later when read and working with, php crashes,
from
the parse_tz.c, in timelib_get_time_zone_info. the Exception is "read at
offset
0x00000010". it would appear that ts and / or tz is zero.
Test script:
---------------
$temp = unserialize('O:8:"DateTime":3:{s:4:"date";s:20:"10007-06-07
03:51:49";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}');
var_dump($temp);
Expected result:
----------------
error parsing invalid date or just a date with all entries 0.
Actual result:
--------------
php crash [read offset 0x00000010] ~ null pointer + offset. at the file
"ext\date\lib\parse_tz.c"
--
Edit bug report at https://bugs.php.net/bug.php?id=62852&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=62852&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=62852&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=62852&r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=62852&r=fixed
Fixed in SVN and need be documented:
https://bugs.php.net/fix.php?id=62852&r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=62852&r=alreadyfixed
Need backtrace:
https://bugs.php.net/fix.php?id=62852&r=needtrace
Need Reproduce Script:
https://bugs.php.net/fix.php?id=62852&r=needscript
Try newer version:
https://bugs.php.net/fix.php?id=62852&r=oldversion
Not developer issue:
https://bugs.php.net/fix.php?id=62852&r=support
Expected behavior:
https://bugs.php.net/fix.php?id=62852&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=62852&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=62852&r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=62852&r=globals
PHP 4 support discontinued:
https://bugs.php.net/fix.php?id=62852&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=62852&r=dst
IIS Stability:
https://bugs.php.net/fix.php?id=62852&r=isapi
Install GNU Sed:
https://bugs.php.net/fix.php?id=62852&r=gnused
Floating point limitations:
https://bugs.php.net/fix.php?id=62852&r=float
No Zend Extensions:
https://bugs.php.net/fix.php?id=62852&r=nozend
MySQL Configuration Error:
https://bugs.php.net/fix.php?id=62852&r=mysqlcfg