Skip to content

fix: use 3-arg open in t/base.t#13

Draft
toddr-bot wants to merge 1 commit intomainfrom
koan.toddr.bot/fix-two-arg-open
Draft

fix: use 3-arg open in t/base.t#13
toddr-bot wants to merge 1 commit intomainfrom
koan.toddr.bot/fix-two-arg-open

Conversation

@toddr-bot
Copy link
Copy Markdown

Summary

  • Convert the last remaining 2-arg open() to 3-arg form in t/base.t

What: Replace open(my $fh2, $tempfile) with open(my $fh2, "<", $tempfile).

Why: Two-arg open() is susceptible to mode injection if the filename contains special characters (e.g., > , |). The bareword filehandle cleanup was done in c5f564a, but this 2-arg open was left behind. Closes #8.

How: One-line change — added the explicit "<" mode argument.

Testing: t/base.t and t/file.t both pass.

🤖 Generated with Claude Code

Convert the remaining 2-arg open() to 3-arg form. Two-arg open is
susceptible to mode injection if the filename contains special
characters. This was the last instance after the bareword filehandle
cleanup in c5f564a.

Closes #8

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

uses barewords for file handles. we should fix this.

1 participant