Skip to content

Fix: DEREF_AFTER_NULL.EX.COND phpdbg: add NULL check for param in PHPDBG_LIST(lines) - #24040

Closed
ushevchenko wants to merge 1 commit into
php:masterfrom
ushevchenko:fix-phpdbg-list-null-param
Closed

ushevchenko wants to merge 1 commit into
php:masterfrom
ushevchenko:fix-phpdbg-list-null-param

Conversation

@ushevchenko

Copy link
Copy Markdown

Problem:

PHPDBG_COMMAND(list) passes a NULL param to PHPDBG_LIST(lines), which dereferences it in switch (param->type) without a NULL check. A NULL pointer may be dereferenced.

Solution: add a NULL check at the beginning of PHPDBG_LIST(lines): report an error and return SUCCESS.

Signed-off-by: u.shevchenko@fobos-nt.ru
Signed-off-by: crystarm@altlinux.org

Fixes #24038

Problem:
PHPDBG_COMMAND(list) passes a NULL param to PHPDBG_LIST(lines), which dereferences it in switch (param->type) without a NULL check. A NULL pointer may be dereferenced.
Solution: add a NULL check at the beginning of PHPDBG_LIST(lines): report an error and return SUCCESS.
Signed-off-by: u.shevchenko@fobos-nt.ru
Signed-off-by: crystarm@altlinux.org
@ushevchenko ushevchenko changed the title Fix: DEREF_AFTER_NULL.EX.COND Fix: DEREF_AFTER_NULL.EX.COND phpdbg: add NULL check for param in PHPDBG_LIST(lines) Oct 1, 2026
@ndossche ndossche closed this Oct 1, 2026
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.

phpdbg: possible NULL dereference of param in PHPDBG_LIST(lines) when called from PHPDBG_COMMAND(list)

2 participants