mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* Packet::readFrom() payload_len guard
This commit is contained in:
parent
2f047da3a3
commit
c942aa06f9
1 changed files with 1 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue