- Core:
. Fixed bug #78363 (Buffer overflow in zendparse). (Nikita)
+ . Fixed bug #78379 (Cast to object confuses GC, causes crash). (Dmitry)
- Curl:
. Fixed bug #77946 (Bad cURL resources returned by curl_multi_info_read()).
--- /dev/null
+--TEST--
+Bug #78379 (Cast to object confuses GC, causes crash)
+--INI--
+opcache.enable=0
+--FILE--
+<?php
+class C {
+ public function __construct() {
+ $this->p = (object)["x" => [1]];
+ }
+}
+class E {
+}
+$e = new E;
+$e->f = new E;
+$e->f->e = $e;
+$e->a = new C;
+$e = null;
+gc_collect_cycles();
+var_dump(new C);
+?>
+--EXPECTF--
+object(C)#%d (1) {
+ ["p"]=>
+ object(stdClass)#%d (1) {
+ ["x"]=>
+ array(1) {
+ [0]=>
+ int(1)
+ }
+ }
+}
if (zobj->properties) {
*table = NULL;
*n = 0;
+ if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)
+ && EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) {
+ GC_REFCOUNT(zobj->properties)--;
+ zobj->properties = zend_array_dup(zobj->properties);
+ }
return zobj->properties;
} else {
*table = zobj->properties_table;