Skip to content

Fix crash on !p command, getTZ() bounds check, and worldmap JS variable#302

Open
Bwooce wants to merge 1 commit intoG4lile0:betafrom
Bwooce:clean/bugfixes
Open

Fix crash on !p command, getTZ() bounds check, and worldmap JS variable#302
Bwooce wants to merge 1 commit intoG4lile0:betafrom
Bwooce:clean/bugfixes

Conversation

@Bwooce
Copy link

@Bwooce Bwooce commented Feb 17, 2026

Summary

Pre-work for an upcoming update to the LilyGo/TTGO T-Beam Supreme support. These are standalone bug fixes found during that development.

  • Guard !p test packet command when radio HAL is not yet initialized (crash at Radio::sendTx when board is unconfigured)
  • Fix getTZ() to return "GMT0" when timezone string is shorter than 3 characters, preventing out-of-bounds read
  • Fix worldmap JavaScript using undefined x.status instead of wmx.status

Changes

  • tinyGS.ino: add radio.isReady() check before !p handler
  • ConfigManager.h: add strlen guard in getTZ()
  • html.h: fix variable reference in worldmap script

3 files changed, 7 insertions(+), 2 deletions(-)

Test plan

  • Build and verify all environments compile (ESP32, ESP32-S3, ESP32-C3, SX1280)
  • Send !p on unconfigured board -- prints error instead of crashing
  • Verify worldmap dashboard loads without JS errors

Testing

Tested on LilyGo T-Beam Supreme (ESP32-S3 + SX1262) running continuously for 3+ days with no stability issues.

Disclosure

This PR was built with AI assistance (Claude) under full human supervision, with all changes reviewed and tested on hardware by the author.

Three independent stability fixes:

1. Guard !p command when radio HAL not initialized - the test packet
   command dereferences radioHal without checking, crashing on
   unconfigured boards.

2. Guard getTZ() against short/empty timezone buffer - unconditionally
   skipping 3 chars for deduplication prefix reads past buffer end on
   first boot. Returns "GMT0" as safe default.

3. Correct worldmap JS variable reference - AJAX handler used
   'x.status' (console script variable) instead of 'wmx.status',
   preventing worldmap data updates when both scripts are active.
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.

1 participant