Try-fix: Remove logging of actual payload strings (and compressed) for TAK packets (#3922)

* Remove logging of actual payload strings (and compressed) for TAK packets

* Don't assert / reboot. Log error and skip decode
This commit is contained in:
Ben Meadors
2024-05-19 07:24:10 -05:00
committed by GitHub
parent 84d3117a7a
commit 4a05874dba
2 changed files with 14 additions and 22 deletions

View File

@@ -311,7 +311,10 @@ bool perhapsDecode(meshtastic_MeshPacket *p)
if (channels.decryptForHash(chIndex, p->channel)) {
// Try to decrypt the packet if we can
size_t rawSize = p->encrypted.size;
assert(rawSize <= sizeof(bytes));
if (rawSize > sizeof(bytes)) {
LOG_ERROR("Packet too large to attempt decription! (rawSize=%d > 256)\n", rawSize);
return false;
}
memcpy(bytes, p->encrypted.bytes,
rawSize); // we have to copy into a scratch buffer, because these bytes are a union with the decoded protobuf
crypto->decrypt(p->from, p->id, rawSize, bytes);