summaryrefslogtreecommitdiff
path: root/ext/date/php_date.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-08-02 16:41:48 +0200
committerAnatol Belski <ab@php.net>2017-08-02 16:41:48 +0200
commit1fdc51897195fb4b7993260ab5d85e11e416f12e (patch)
tree572443976cb25cba67c5f374e100b3f1ea7c60a7 /ext/date/php_date.c
parent5f030924c19a39c09b57d40615f754cf80ae0e7d (diff)
parentb112d09013088e73676eee77f04a906d15fbd1a7 (diff)
downloadphp-git-1fdc51897195fb4b7993260ab5d85e11e416f12e.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fixed bug #75002 Null Pointer Dereference in timelib_time_clone
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r--ext/date/php_date.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index dcc71a402b..fb98fab893 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1944,6 +1944,10 @@ static void date_period_it_rewind(zend_object_iterator *iter)
if (iterator->object->current) {
timelib_time_dtor(iterator->object->current);
}
+ if (!iterator->object->start) {
+ zend_throw_error(NULL, "DatePeriod has not been initialized correctly");
+ return;
+ }
iterator->object->current = timelib_time_clone(iterator->object->start);
date_period_it_invalidate_current(iter);
}