diff options
author | Thomas Punt <tpunt@hotmail.co.uk> | 2016-03-07 09:40:22 +0000 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-03-11 14:08:48 +0100 |
commit | f3f5a07aa569d6fba599afcd69c04d6626c57c3f (patch) | |
tree | 520133da209a01041f6d0fda9eef1d45a05cf241 /ext/date/php_date.c | |
parent | 8cd903ea685a6ef56aa77e95c00db8aac53a7c39 (diff) | |
download | php-git-f3f5a07aa569d6fba599afcd69c04d6626c57c3f.tar.gz |
Fix DatePeriod::getEndDate() segfault
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r-- | ext/date/php_date.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index e06ace7f8b..4cb0ec8ff4 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -4536,6 +4536,10 @@ PHP_METHOD(DatePeriod, getEndDate) dpobj = (php_period_obj *)zend_object_store_get_object(getThis() TSRMLS_CC); + 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); dateobj->time = timelib_time_ctor(); |