Licensed channel defaults, phone map growth, and payload read bounds (#11286)

* Strip the default PSK when licensed defaults are installed

* Only record rate-limited portnums from the phone

* Bound payload reads by the received size
This commit is contained in:
Thomas Göttgens authored and GitHub committed 2026-07-29 22:29:12 +00:00
1 parent df6e67f70b
commit daf1213580
4 files changed
+23 -6

No files matched your search

+6 -1
View File
@@ -1855,7 +1855,12 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p)
p.want_ack = true;
}
lastPortNumToRadio[p.decoded.portnum] = millis();
// Only the rate-limited ports above are ever read back, so recording any other portnum would let
// a client grow this map without bound by cycling through them.
if (IS_ONE_OF(p.decoded.portnum, meshtastic_PortNum_TRACEROUTE_APP, meshtastic_PortNum_POSITION_APP,
meshtastic_PortNum_WAYPOINT_APP, meshtastic_PortNum_ALERT_APP, meshtastic_PortNum_TELEMETRY_APP,
meshtastic_PortNum_TEXT_MESSAGE_APP))
lastPortNumToRadio[p.decoded.portnum] = millis();
service->handleToRadio(p);
return true;
}