Skip to content

Fix atfork parent/child loop decrement causing infinite loop and OOB - #1067

Merged
ptitSeb merged 1 commit into
ptitSeb:masterfrom
As9xm:fix/atfork-parent-child-loop
Sep 10, 2026
Merged

ptitSeb merged 1 commit into
ptitSeb:masterfrom
As9xm:fix/atfork-parent-child-loop

Conversation

@As9xm

@As9xm As9xm commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

x86emu_fork ran parent/child atfork handlers with 'for (i=0; i<sz; --i)'. With sz>0, i goes 0,-1,-2... staying <sz forever: infinite loop plus out-of-bounds atforks[i] access. The prepare loop just above correctly iterates reverse with '--i' from sz-1. Change parent/child loops to '++i' for forward iteration.

x86emu_fork ran parent/child atfork handlers with 'for (i=0; i<sz; --i)'. With sz>0, i goes 0,-1,-2... staying <sz forever: infinite loop plus out-of-bounds atforks[i] access. The prepare loop just above correctly iterates reverse with '--i' from sz-1. Change parent/child loops to '++i' for forward iteration.
@ptitSeb
ptitSeb merged commit 14181b5 into ptitSeb:master Sep 10, 2026
36 checks passed
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