Update src/mesh/udp/UdpMulticastHandler.h

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ben Meadors
2025-09-27 06:06:05 -05:00
committed by GitHub
parent 42532d5b7c
commit 2b590d2300

View File

@@ -78,6 +78,11 @@ class UdpMulticastHandler final
if (!mp || !udp) {
return false;
}
// Validate channel index before accessing
if (chIndex < 0 || chIndex >= channels.size()) {
LOG_ERROR("Invalid channel index %d in UDP onSend", chIndex);
return false;
}
// Check if uplink is enabled for this specific channel
auto &ch = channels.getByIndex(chIndex);
if (!ch.settings.uplink_enabled) {