Skip to content

fix: remove TOCTOU race in RunState.load - #3839

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/load-state-toctou
Open

fix: remove TOCTOU race in RunState.load#3839
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/load-state-toctou

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Summary

Remove exists() check before open() and catch FileNotFoundError directly to prevent TOCTOU race.

Changes

  • engine.py: Replaced exists()+open() with open() wrapped in try/except FileNotFoundError

Remove exists() check before open() and catch FileNotFoundError directly.
This prevents a race where the file is deleted between check and open,
while preserving the descriptive error message.
@Quratulain-bilal
Quratulain-bilal requested a review from mnriem as a code owner July 29, 2026 07:41
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.

1 participant