From: Xinchen Hui Date: Thu, 21 Jul 2016 06:25:15 +0000 (+0800) Subject: Fixed bug #72639 (Segfault when instantiating class that extends IntlCalendar and... X-Git-Tag: php-7.0.10RC1~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a643e5e1362951362b5eb4a30af0d5068ca6686;p=php Fixed bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property) --- diff --git a/NEWS b/NEWS index af9ce204ae..d50ba56e19 100644 --- a/NEWS +++ b/NEWS @@ -41,6 +41,8 @@ PHP NEWS blendingmode). (cmb) - Intl: + . Fixed bug #72639 (Segfault when instantiating class that extends + IntlCalendar and adds a property). (Laruence) . Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain names). (cmb) diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp index 72cd7e1dd0..4414a7a092 100644 --- a/ext/intl/calendar/calendar_class.cpp +++ b/ext/intl/calendar/calendar_class.cpp @@ -261,7 +261,7 @@ static zend_object *Calendar_object_create(zend_class_entry *ce) intern = (Calendar_object*)ecalloc(1, sizeof(Calendar_object) + sizeof(zval) * (ce->default_properties_count - 1)); zend_object_std_init(&intern->zo, ce); - object_properties_init((zend_object*) intern, ce); + object_properties_init(&intern->zo, ce); calendar_object_init(intern); diff --git a/ext/intl/tests/bug72639.phpt b/ext/intl/tests/bug72639.phpt new file mode 100644 index 0000000000..2c94dcc06f --- /dev/null +++ b/ext/intl/tests/bug72639.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +object(A)#%d (1) { + ["valid"]=> + bool(false) +}