Skip to content

Security fixes - #8

Merged
jancona merged 1 commit into
jancona:masterfrom
sp5wwp:master
Oct 5, 2026
Merged

jancona merged 1 commit into
jancona:masterfrom
sp5wwp:master

Conversation

@sp5wwp

@sp5wwp sp5wwp commented Oct 5, 2026

Copy link
Copy Markdown
Contributor
  • Make NewPacketFromBytes check the buffer length and return an error instead of panicking. This fixes a remote crash of m17-bridge from a single short M17P datagram, and the same crash in the gateway's reflector client and RF path.
  • The exported signature of NewPacketFromBytes changes to return (Packet, error); all in-repo callers are updated.
  • Stop the gateway crashing when DashboardLog is blank by making the dashboard logger a no-op when it wraps a nil slog.Logger.
  • Open the gateway and bridge log files with O_APPEND instead of overwriting from the start, and drop O_SYNC to reduce SD card writes.
  • Add Packet.SMSText() to trim the NUL terminator instead of always dropping the last byte.
  • Add regression tests for short packets, the nil dashboard logger and SMS text handling.

- Make NewPacketFromBytes check the buffer length and return an error instead of panicking. This fixes a remote crash of m17-bridge from a single short M17P datagram, and the same crash in the gateway's reflector client and RF path.
- The exported signature of NewPacketFromBytes changes to return (Packet, error); all in-repo callers are updated.
- Stop the gateway crashing when DashboardLog is blank by making the dashboard logger a no-op when it wraps a nil slog.Logger.
- Open the gateway and bridge log files with O_APPEND instead of overwriting from the start, and drop O_SYNC to reduce SD card writes.
- Add Packet.SMSText() to trim the NUL terminator instead of always dropping the last byte.
- Add regression tests for short packets, the nil dashboard logger and SMS text handling.
@jancona
jancona merged commit d51191c into jancona:master Oct 5, 2026
@jancona

jancona commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Thanks!

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