Browse Source

Merge ac927a4044 into 5f3b7f25d0

pull/1654/merge
Wessel 1 day ago
committed by GitHub
parent
commit
7c7c6528e9
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      src/Mesh.cpp

4
src/Mesh.cpp

@ -157,6 +157,10 @@ DispatcherAction Mesh::onRecvPacket(Packet* pkt) {
uint8_t path_len = data[k++];
uint8_t hash_size = (path_len >> 6) + 1;
uint8_t hash_count = path_len & 63;
if (k + hash_size*hash_count + 1 > len) { // bounds check: need path bytes + extra_type byte
MESH_DEBUG_PRINTLN("%s Mesh::onRecvPacket(): bad PATH payload format, path_len=%d len=%d", getLogDateTime(), (int)path_len, (int)len);
break;
}
uint8_t* path = &data[k]; k += hash_size*hash_count;
uint8_t extra_type = data[k++] & 0x0F; // upper 4 bits reserved for future use
uint8_t* extra = &data[k];

Loading…
Cancel
Save