Skip to content

Commit

Permalink
Ignore invalid service envelopes (meshtastic#4326)
Browse files Browse the repository at this point in the history
  • Loading branch information
thebentern authored and fifieldt committed Jul 29, 2024
1 parent eeea06f commit 72ee811
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mqtt/MQTT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ void MQTT::onReceive(char *topic, byte *payload, size_t length)
LOG_ERROR("Invalid MQTT service envelope, topic %s, len %u!\n", topic, length);
return;
} else {
if (e.channel_id == NULL || e.gateway_id == NULL) {
LOG_ERROR("Invalid MQTT service envelope, topic %s, len %u!\n", topic, length);
return;
}
meshtastic_Channel ch = channels.getByName(e.channel_id);
if (strcmp(e.gateway_id, owner.id) == 0) {
// Generate an implicit ACK towards ourselves (handled and processed only locally!) for this message.
Expand Down

0 comments on commit 72ee811

Please sign in to comment.