Repository navigation
fix(cli): reject NUL bytes in Go binary paths - #9724
ShuaixinHuang wants to merge 1 commit into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36c6d85ac2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const localPath = z | ||
| .string() | ||
| .min(1) | ||
| .regex(/^[^\x00]*$/u, "Local path cannot contain NUL"); |
There was a problem hiding this comment.
Reuse the shared local-path contract
This introduces a second definition of the nonempty/NUL-free path invariant already owned by localPathStringSchema in src/domain/localPath.ts. The Go service uses that shared schema, and src/cli/firmwareCommands.ts already demonstrates direct reuse with incur. Although the constraints currently match, maintaining an independent CLI definition leaves this validation fix split across two owners, contrary to AGENTS.md's requirement to resolve duplicated interpretation within bug fixes. Import the shared schema, or reuse inspectGoBinaryInputSchema.shape.path, instead of recreating it here.
AGENTS.md reference: AGENTS.md:L25-L25
Useful? React with 👍 / 👎.
Addresses #9722.
Aligns the Go binary CLI path schema with the runtime localPathStringSchema by rejecting empty and NUL-containing paths before execution.
Author readiness
Human owner: @ShuaixinHuang