Skip to content

Dereference of null pointer before initial check. - #24122

Open
M0T1VaTeD wants to merge 1 commit into
php:masterfrom
M0T1VaTeD:additional_null_check
Open

M0T1VaTeD wants to merge 1 commit into
php:masterfrom
M0T1VaTeD:additional_null_check

Conversation

@M0T1VaTeD

Copy link
Copy Markdown

Problem: pointer "key" is checked for null at var.c:1016, but is dereferenced right before the check.
Solution: additional check for "key" before dereferencing.

Problem: pointer "key" is checked for null at var.c:1016, but is dereferenced right before the check.
Solution: additional check for "key" before dereferencing.

Signed-off-by: David Meliksetyan <d.meliksetyan@fobos-nt.ru>
Signed-off-by: Georgij Tsarin <cristarm@altlinux.org>
@devnexen

devnexen commented Oct 5, 2026

Copy link
Copy Markdown
Member

Hi @M0T1VaTeD ! would it be possible to provide a test that would make php crash without your fix ? Thanks.

@LamentXU123

LamentXU123 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

I think this is more of a defensive optimization rather than an actual bug fix so its not necessaryly testable? So it is targeting master wdyt @devnexen

@devnexen

devnexen commented Oct 5, 2026

Copy link
Copy Markdown
Member

I think this is more of a defensive optimization rather than an actual bug fix so its not necessaryly testable? So it is targeting master wdyt @devnexen

I knew it was not testable, my point being if there is no bug there is no fix to merge.

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.

3 participants