summaryrefslogtreecommitdiff
path: root/ext/intl
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2016-07-21 14:25:36 +0800
committerXinchen Hui <laruence@gmail.com>2016-07-21 14:25:36 +0800
commitbdd3f77be05f786a0140f835c04b114fe26c7272 (patch)
tree273ac4b1e2b8877d3b7c9ee1a2b350dc8de5b6e2 /ext/intl
parentc9af9c78f1977e0a88446750ddbc6dc740877df7 (diff)
parent4a643e5e1362951362b5eb4a30af0d5068ca6686 (diff)
downloadphp-git-bdd3f77be05f786a0140f835c04b114fe26c7272.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fixed bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property)
Diffstat (limited to 'ext/intl')
-rw-r--r--ext/intl/calendar/calendar_class.cpp2
-rw-r--r--ext/intl/tests/bug72639.phpt17
2 files changed, 18 insertions, 1 deletions
diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp
index d8a9995100..a2024c0712 100644
--- a/ext/intl/calendar/calendar_class.cpp
+++ b/ext/intl/calendar/calendar_class.cpp
@@ -254,7 +254,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--
+<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
+--FILE--
+<?php
+class A extends IntlCalendar {
+ public function __construct() {}
+ private $a;
+}
+var_dump(new A());
+?>
+--EXPECTF--
+object(A)#%d (1) {
+ ["valid"]=>
+ bool(false)
+}