From 5222cc2032a5125d77fc8b27af924a4073ecfa46 Mon Sep 17 00:00:00 2001 From: nielsdos <7771979+nielsdos@users.noreply.github.com> Date: Fri, 24 Feb 2023 16:53:20 +0100 Subject: [PATCH] Fix incorrect type for return value of zend_update_static_property_ex() zend_update_static_property_ex() returns a zend_result, but the return value is stored here in a bool. A bool is unsigned on my system, so in case zend_update_static_property_ex() returns FAILURE (== -1) this gets converted to 1 instead. This is not a valid zend_result value. This means that (transitive) callers could mistakingly think the function succeeded while it did in fact not succeed. Fix it by changing the type to zend_result. --- Zend/zend_API.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index e8ff66fe97ed0..f59035be3f1b3 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -4658,7 +4658,7 @@ ZEND_API zend_result zend_update_static_property_ex(zend_class_entry *scope, zen ZEND_API zend_result zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value) /* {{{ */ { zend_string *key = zend_string_init(name, name_length, 0); - bool retval = zend_update_static_property_ex(scope, key, value); + zend_result retval = zend_update_static_property_ex(scope, key, value); zend_string_efree(key); return retval; }