mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-03-30 12:45:45 +00:00
* Packet::readFrom() payload_len guard
This commit is contained in:
@@ -52,6 +52,7 @@ bool Packet::readFrom(const uint8_t src[], uint8_t len) {
|
||||
memcpy(path, &src[i], path_len); i += path_len;
|
||||
if (i >= len) return false; // bad encoding
|
||||
payload_len = len - i;
|
||||
if (payload_len > sizeof(payload)) return false; // bad encoding
|
||||
memcpy(payload, &src[i], payload_len); //i += payload_len;
|
||||
return true; // success
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user