Skip to content

fix(cli): reject NUL bytes in Go binary paths - #9724

Closed
ShuaixinHuang wants to merge 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/go-path-nul-v2
Closed

ShuaixinHuang wants to merge 1 commit into
morluto:mainfrom
ShuaixinHuang:fix/go-path-nul-v2

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T01:14:24.367487Z 36c6d85 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread src/cli/goCommands.ts
Comment on lines +3 to +6
const localPath = z
.string()
.min(1)
.regex(/^[^\x00]*$/u, "Local path cannot contain NUL");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@morluto morluto closed this Nov 10, 2026
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