com php-src: Fixed bug #78644: NEWS Zend/tests/bug78644.phpt Zend/zend_execute.c
| From: | Nikita Popov | Date: | Tue, 08 Oct 2019 12:32:49 +0000 |
| Subject: | com php-src: Fixed bug #78644: NEWS Zend/tests/bug78644.phpt Zend/zend_execute.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-108803@lists.php.net to get a copy of this message | ||
Commit: ad3ddf46f9f5c97c43f04612bb448fcd109e2926
Author: Nikita Popov <nikita.ppv@gmail.com> Tue, 8 Oct 2019 14:30:53 +0200
Parents: d1de1777e9fcc2aa641f321aaf7b0fc9f7773e38
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ad3ddf46f9f5c97c43f04612bb448fcd109e2926
Log:
Fixed bug #78644
Make sure the initialize the result of FETCH_OBJ_UNSET operations.
I'm using a NULL value rather than ERROR here, because the latter
no longer exists in master.
Bugs:
https://bugs.php.net/78644
Changed paths:
M NEWS
A Zend/tests/bug78644.phpt
M Zend/zend_execute.c
Diff:
diff --git a/NEWS b/NEWS
index 8f79383ca56..ff37a024b12 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ PHP NEWS
. Fixed bug #78620 (Out of memory error). (cmb, Nikita)
. Fixed bug #78632 (method_exists() in php74 works differently from php73 in
checking priv. methods). (Nikita)
+ . Fixed bug #78644 (SEGFAULT in ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER).
+ (Nikita)
- Iconv:
. Fixed bug #78642 (Wrong libiconv version displayed). (gedas at martynas,
diff --git a/Zend/tests/bug78644.phpt b/Zend/tests/bug78644.phpt
new file mode 100644
index 00000000000..3889e9fb05c
--- /dev/null
+++ b/Zend/tests/bug78644.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #78644: SEGFAULT in ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER
+--FILE--
+<?php
+
+$a = new stdClass;
+unset($a->b->c->d);
+unset($a->b->c['d']);
+var_dump($a);
+
+?>
+--EXPECT--
+object(stdClass)#1 (1) {
+ ["b"]=>
+ NULL
+}
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 42822785cb7..15f3ee792a2 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -2765,6 +2765,7 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval
*c
/* this should modify object only if it's empty */
if (type == BP_VAR_UNSET) {
+ ZVAL_NULL(result);
return;
}