Skip to content

Add NULL check on zend_get_called_scope() return value in PhpToken::tokenize() - #23703

Open
ushevchenko wants to merge 1 commit into
php:masterfrom
ushevchenko:fix/tokenize-null-check
Open

ushevchenko wants to merge 1 commit into
php:masterfrom
ushevchenko:fix/tokenize-null-check

Conversation

@ushevchenko

Copy link
Copy Markdown

Fixes #23700

Adds a NULL check on the return value of zend_get_called_scope() in PhpToken::tokenize() (ext/tokenizer/tokenizer.c), consistent with how this function's return value is checked at other call sites in the codebase. See the linked issue for details — this was flagged by static analysis (statistical NULL-deref checker), not by an observed crash.

Problem:
Return value of zend_get_called_scope() is dereferenced in PhpToken::tokenize() without checking for NULL.
Solution: added NULL check for token_class before dereference.
Signed-off-by: u.shevchenko@fobos-nt.ru
Signed-off-by: crystarm@altlinux.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing NULL check on zend_get_called_scope() in PhpToken::tokenize() (ext/tokenizer/tokenizer.c)

1 participant