Skip to content

p2p/kademlia: add nil guards to connWrapper and pool#176

Merged
mateeullahmalik merged 1 commit intomasterfrom
cw-guards
Sep 18, 2025
Merged

p2p/kademlia: add nil guards to connWrapper and pool#176
mateeullahmalik merged 1 commit intomasterfrom
cw-guards

Conversation

@mateeullahmalik
Copy link
Collaborator

  • What: Add nil-safety to connWrapper and prevent typed-nil wrappers entering the pool.
  • Changes:
    • Guard Read/Write/Set Deadline against nil receiver/inner conns, return io.ErrClosedPipe.
    • Make Close/LocalAddr/RemoteAddr nil-safe.
    • Ignore typed-nil *connWrapper in ConnPool.Add.
  • Why: Prevents "RARE" typed-nil interface cases from causing hangs or panics in Kademlia read/write paths.
  • Impact: No behavior change for valid connections; safer failure mode for invalid wrappers. No public API changes.

@mateeullahmalik mateeullahmalik merged commit e368dab into master Sep 18, 2025
7 checks passed
@mateeullahmalik mateeullahmalik deleted the cw-guards branch December 15, 2025 08:03
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