Skip to content

Conversation

@raggi
Copy link
Member

@raggi raggi commented Jan 13, 2026

  • Fix bounds checking: check if copy() filled buffer (n >= len(out)) instead of incorrect len(out) < len(src)-1 (thank you @kitknox / out-of-bounds panic in buffer copy #45)
  • Fix nil pointer dereference in 12 functions when getServer fails
  • Fix syntax error in TsnetDial referencing undefined variable
  • Simplify getServer to return *server instead of (*server, error) to avoid repetition of fixed bugs

Fixes #45

- Fix bounds checking: check if copy() filled buffer (n >= len(out))
  instead of incorrect len(out) < len(src)-1 (thank you @kitknox / #45)
- Fix nil pointer dereference in 12 functions when getServer fails
- Fix syntax error in TsnetDial referencing undefined variable
- Simplify getServer to return *server instead of (*server, error)
  to avoid repetition of fixed bugs

Fixes #45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes critical bugs in the C API including nil pointer dereferences, incorrect bounds checking logic, and syntax errors.

Changes:

  • Fixed bounds checking logic to check n >= len(out) instead of incorrect len(out) < len(src)-1
  • Fixed nil pointer dereferences in 12 functions by simplifying getServer to return *server and checking for nil
  • Fixed syntax errors in TsnetDial and variable declaration in TsnetUp

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@raggi raggi merged commit 6567023 into main Jan 20, 2026
9 of 10 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.

3 participants