Skip to content

[codex] prevent panic on bare NNTP IHAVE#24

Merged
ralyodio merged 1 commit into
profullstack:mainfrom
lazyGPT07:codex/nntp-ihave-syntax
Jun 15, 2026
Merged

[codex] prevent panic on bare NNTP IHAVE#24
ralyodio merged 1 commit into
profullstack:mainfrom
lazyGPT07:codex/nntp-ihave-syntax

Conversation

@lazyGPT07

Copy link
Copy Markdown
Contributor

What changed

  • reject bare IHAVE commands with NNTP 501 before reading the message-id argument
  • add a protocol-level regression test that sends IHAVE, verifies 501, and confirms the connection still accepts QUIT

Why

handleIHave accessed args[0] without validating the argument count. A client could therefore trigger an index-out-of-range panic by sending IHAVE without a message-id.

Fixes #23.

Validation

  • go test ./internal/news/nntpd -run 'TestIHaveWithoutMessageIDReturnsSyntaxError|TestProcessCollapsesRepeatedCommandWhitespace' -count=1
  • all Go packages except internal/sites pass locally; that package's existing Windows-only symlink test requires a privilege unavailable in this environment
  • go vet ./...

@ralyodio ralyodio merged commit c480e62 into profullstack:main Jun 15, 2026
5 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.

NNTP IHAVE without a message-id can panic the server

2 participants