Skip to content

Commit 8959ff3

Browse files
nielsdosdevnexen
authored andcommitted
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. Closes GH-10691.
1 parent 91db3a1 commit 8959ff3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ PHP NEWS
1212
function after bailout). (trowski)
1313
. Fixed SSA object type update for compound assignment opcodes. (nielsdos)
1414
. Fixed language scanner generation build. (Daniel Black)
15+
. Fixed zend_update_static_property() calling zend_update_static_property_ex()
16+
misleadingly with the wrong return type. (nielsdos)
1517

1618
- Curl:
1719
. Fixed deprecation warning at compile time. (Max Kellermann)

Zend/zend_API.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4658,7 +4658,7 @@ ZEND_API zend_result zend_update_static_property_ex(zend_class_entry *scope, zen
46584658
ZEND_API zend_result zend_update_static_property(zend_class_entry *scope, const char *name, size_t name_length, zval *value) /* {{{ */
46594659
{
46604660
zend_string *key = zend_string_init(name, name_length, 0);
4661-
bool retval = zend_update_static_property_ex(scope, key, value);
4661+
zend_result retval = zend_update_static_property_ex(scope, key, value);
46624662
zend_string_efree(key);
46634663
return retval;
46644664
}

0 commit comments

Comments
 (0)