]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6' into PHP-7.0
authorAnatol Belski <ab@php.net>
Fri, 11 Mar 2016 13:12:54 +0000 (14:12 +0100)
committerAnatol Belski <ab@php.net>
Fri, 11 Mar 2016 13:12:54 +0000 (14:12 +0100)
* PHP-5.6:
  Fix DatePeriod::getEndDate() segfault

1  2 
ext/date/php_date.c

index 2fe78a0e69fbd8c08e24cfeaf75887a847486344,4cb0ec8ff40d4b24529b719ddcc1bba260de9da9..c2ef1778945fba035c00e70caa68d0fa1b29e779
@@@ -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());
  
 -        php_date_instantiate(dpobj->start_ce, return_value TSRMLS_CC);
 -        dateobj = (php_date_obj *)zend_object_store_get_object(return_value TSRMLS_CC);
+         if (!dpobj->end) {
+                 return;
+         }
 +        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) {