Bug #69541 [Opn->Asn]: mktime() with date.timezone set crashes

From: Date: Tue, 28 Apr 2015 07:10:52 +0000
Subject: Bug #69541 [Opn->Asn]: mktime() with date.timezone set crashes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192372@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: kalle@php.net Reported by: kalle@php.net Summary: mktime() with date.timezone set crashes -Status: Open +Status: Assigned Type: Bug Package: Date/time related Operating System: PHP7 PHP Version: master-Git-2015-04-28 (Git) -Assigned To: +Assigned To: derick Block user comment: N Private report: N 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

« previous php.bugs (#192372) next »