From: Anatol Belski Date: Fri, 11 Mar 2016 13:12:54 +0000 (+0100) Subject: Merge branch 'PHP-5.6' into PHP-7.0 X-Git-Tag: php-7.1.0alpha1~493^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d26d80ab75e9e495fbda391a9cb0467cf185f39e;p=php Merge branch 'PHP-5.6' into PHP-7.0 * PHP-5.6: Fix DatePeriod::getEndDate() segfault --- d26d80ab75e9e495fbda391a9cb0467cf185f39e diff --cc ext/date/php_date.c index 2fe78a0e69,4cb0ec8ff4..c2ef177894 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@@ -4445,10 -4534,14 +4445,14 @@@ PHP_METHOD(DatePeriod, getEndDate return; } - dpobj = (php_period_obj *)zend_object_store_get_object(getThis() TSRMLS_CC); + dpobj = Z_PHPPERIOD_P(getThis()); + if (!dpobj->end) { + return; + } + - php_date_instantiate(dpobj->start_ce, return_value TSRMLS_CC); - dateobj = (php_date_obj *)zend_object_store_get_object(return_value TSRMLS_CC); + php_date_instantiate(dpobj->start_ce, return_value); + dateobj = Z_PHPDATE_P(return_value); dateobj->time = timelib_time_ctor(); *dateobj->time = *dpobj->end; if (dpobj->end->tz_abbr) {