mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix OSS-Fuzz #428053935 (#18969)
Registering the constant may happen under another name due to lowercasing. This will cause the lookup to the constant to fail. Instead of looking it up, just change the Zend API to return a pointer instead.
This commit is contained in:
parent
db157e3168
commit
4a18c895ca
7 changed files with 34 additions and 16 deletions
|
@ -592,7 +592,7 @@ register_constant:
|
|||
/* non persistent */
|
||||
ZEND_CONSTANT_SET_FLAGS(&c, 0, PHP_USER_CONSTANT);
|
||||
c.name = zend_string_copy(name);
|
||||
if (zend_register_constant(&c) == SUCCESS) {
|
||||
if (zend_register_constant(&c) != NULL) {
|
||||
RETURN_TRUE;
|
||||
} else {
|
||||
RETURN_FALSE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue