Skip to content

Fix phpdbg segmentation fault in case of malformed input #10353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

nielsdos
Copy link
Member

If you were to enter "w $>" the function would crash with a segmentation fault because last_index is still NULL at that point. Fix it by checking for NULL and erroring out if it is.

Even though this is a very minor bug, I think it's worth it to fix this because accidentally entering malformed input could crash your debugging session.

Note:
I found this issue using a static analyser. I manually verified the issue by writing a test case. After fixing this the analyser no longer complains.

If you were to enter "w $>" the function would crash with a segmentation
fault because last_index is still NULL at that point. Fix it by checking
for NULL and erroring out if it is.
@nielsdos nielsdos force-pushed the fix-phpdbg-malformed-watch-name branch from 18f5afc to 1b4d38a Compare January 16, 2023 22:53
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LCTM

@devnexen devnexen requested a review from Girgias January 17, 2023 07:37
@Girgias Girgias self-assigned this Jan 17, 2023
@Girgias Girgias closed this in 398a10a Jan 17, 2023
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