check payload size

pull/2694/head
mverch67 2023-08-08 20:02:29 +02:00
rodzic 1d0ac2caf7
commit 1986267d65
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -224,7 +224,7 @@ void CannedMessageModule::sendText(NodeNum dest, const char *message, bool wantR
p->want_ack = true;
p->decoded.payload.size = strlen(message);
memcpy(p->decoded.payload.bytes, message, p->decoded.payload.size);
if (moduleConfig.canned_message.send_bell) {
if (moduleConfig.canned_message.send_bell && p->decoded.payload.size < meshtastic_Constants_DATA_PAYLOAD_LEN) {
p->decoded.payload.bytes[p->decoded.payload.size] = 7; // Bell character
p->decoded.payload.bytes[p->decoded.payload.size + 1] = '\0'; // Bell character
p->decoded.payload.size++;