Bug #69541 [Asn->Csd]: mktime() with date.timezone set crashes
| From: | nikic@php.net | Date: | Thu, 05 Oct 2017 12:25:13 +0000 |
| Subject: | Bug #69541 [Asn->Csd]: mktime() with date.timezone set crashes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-211532@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69541&edit=1
ID: 69541
Updated by: nikic@php.net
Reported by: kalle@php.net
Summary: mktime() with date.timezone set crashes
-Status: Assigned
+Status: Closed
Type: Bug
Package: Date/time related
Operating System: PHP7
PHP Version: master-Git-2015-04-28 (Git)
Assigned To: derick
Block user comment: N
Private report: N
New Comment:
I can't repro, so I assume this was fixed.
Previous Comments:
------------------------------------------------------------------------
[2015-04-28 07:09:13] kalle@php.net
Description:
------------
After the recent tzdb format change, then a simple call to mktime now crashes.
Looking into it a tiny bit shows that the whole magic happens in read_location()
(ext/date/lib/parse_tz.c), buffer[2] which is the length of the comments is passed through the
timelib_conv_int() macro that then causes the number to be negative, thrus making malloc fail
I did not test against the 5.x versions that was also affected by the db update, but I guess the
same problem persists there.
Test script:
---------------
php -r "mktime();" <- No crash
php -d date.timezone=CET -r "mktime();" <- Crash
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69541&edit=1