Skip to content

Conversation

Gofastasf
Copy link
Contributor

  • Replaced os.Stat call and os.Create with os.OpenFile with O_EXCL to avoid TOCTOU.
  • Improved logic to handle file size check only when the file exists.

@Gofastasf Gofastasf force-pushed the fix/OpenDestination-func branch from 45b9602 to 63219da Compare February 2, 2025 19:16
- Replaced os.Stat call and os.Create with os.OpenFile with O_EXCL to avoid TOCTOU.
- Improved logic to handle file size check only when the file exists.

Signed-off-by: Gofastasf <gofastasf@gmail.com>
@Gofastasf Gofastasf force-pushed the fix/OpenDestination-func branch from 63219da to db5e7e1 Compare February 2, 2025 19:32
Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

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

another nice cleanup, thank you @Gofastasf :)

@jaypipes jaypipes merged commit 7e034f0 into jaypipes:main Feb 3, 2025
12 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