summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-10-12 17:56:13 +0200
committerAnatol Belski <ab@php.net>2016-10-12 17:56:13 +0200
commitb1ef60f90e1adb3d21871322ad39fec324d60ef6 (patch)
tree764a96e6b91ae9343b191518c55556babca572d9 /Zend/zend_API.c
parent929b04520e1087eca642243b28569dd14690decb (diff)
parentf42cbd749cde1f91274c1d03df9024baba141a8f (diff)
downloadphp-git-b1ef60f90e1adb3d21871322ad39fec324d60ef6.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fix bug #73147: Use After Free in PHP7 unserialize()
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 6ce60e1f06..a71aca8106 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -3886,6 +3886,24 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c
}
/* }}} */
+ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const char *name, size_t name_length) /* {{{ */
+{
+ zval property;
+ zend_class_entry *old_scope = EG(scope);
+
+ EG(scope) = scope;
+
+ if (!Z_OBJ_HT_P(object)->unset_property) {
+ zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be unset", name, ZSTR_VAL(Z_OBJCE_P(object)->name));
+ }
+ ZVAL_STRINGL(&property, name, name_length);
+ Z_OBJ_HT_P(object)->unset_property(object, &property, 0);
+ zval_ptr_dtor(&property);
+
+ EG(scope) = old_scope;
+}
+/* }}} */
+
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, const char *name, size_t name_length, zend_long value) /* {{{ */
{
zval tmp;