Skip to content
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

Fix NULL arithmetic during system program execution #17470

Closed
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Jan 14, 2025

For the first child process execution, TWG(process) is NULL; we need to catch that to avoid undefined behavior.

@nielsdos
Copy link
Member

Right, so no NULL access, but NULL arithmetic (which indeed is UB).
I think it's slightly better to wrap the for loops in TWG(process), at least it's clearer that way for me.

@cmb69 cmb69 marked this pull request as draft January 14, 2025 22:05
For the first child process execution, `TWG(process)` is `NULL`; we
need to catch that to avoid undefined behavior.
@cmb69 cmb69 force-pushed the cmb/process_get-null branch from 08fcb6d to 2d2150c Compare January 14, 2025 22:42
@cmb69 cmb69 changed the title Fix potential null pointer access during system program execution Fix NULL arithmetic during system program execution Jan 14, 2025
@cmb69
Copy link
Member Author

cmb69 commented Jan 14, 2025

I think it's slightly better to wrap the for loops in TWG(process), at least it's clearer that way for me.

Makes sense. Thank you! Done.

@cmb69 cmb69 marked this pull request as ready for review January 14, 2025 23:18
@cmb69 cmb69 closed this in 022a5fc Jan 15, 2025
@cmb69 cmb69 deleted the cmb/process_get-null branch January 15, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants