Bug #71635 [Opn->Csd]: DatePeriod::getEndDate segfault

From: Date: Fri, 11 Mar 2016 13:28:44 +0000
Subject: Bug #71635 [Opn->Csd]: DatePeriod::getEndDate segfault
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199758@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71635&edit=1 ID: 71635 Updated by: ab@php.net Reported by: tim_siebels_aurich at yahoo dot de Summary: DatePeriod::getEndDate segfault -Status: Open +Status: Closed Type: Bug Package: Date/time related Operating System: Linux PHP Version: 5.6.18 -Assigned To: +Assigned To: ab Block user comment: N Private report: N New Comment: Patch applied to 5.6+. Thanks. Previous Comments: ------------------------------------------------------------------------ [2016-02-21 18:13:47] ab@php.net Thanks for the report and patch. @tpunt, since it's reported against 5.6, could you please create a PR with your prospective patch targeting 5.6 and ping Derick for a review? Thanks. ------------------------------------------------------------------------ [2016-02-20 22:58:35] tpunt@php.net I have a fix for this, though not sure if it's foolproof: https://github.com/php/php-src/compare/master...tpunt:fix-dateperiod-segfault ------------------------------------------------------------------------ [2016-02-19 21:00:58] tim_siebels_aurich at yahoo dot de Description: ------------ When creating a DatePeriod object with no end date, but recurrances given, the runtime segfaults. Test script: --------------- <?php // https://3v4l.org/a044v $period = new DatePeriod(new DateTimeImmutable("now"), new DateInterval("P2Y4DT6H8M"), 2); var_dump($period->getStartDate()); var_dump($period->getEndDate()); Expected result: ---------------- object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-02-19 21:45:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } object(DateTimeImmutable)#8 (1) { ["date"]=> string(26) "2016-02-19 21:59:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(13) "Europe/Berlin" } Actual result: -------------- object(DateTimeImmutable)#2 (3) { ["date"]=> string(26) "2016-02-19 21:45:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" } Process exited with code 139. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71635&edit=1

« previous php.bugs (#199758) next »