Skip to content

Commit 6a1f8d6

Browse files
committed
add missing null terminator for login payload
1 parent b82f5ea commit 6a1f8d6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

examples/simple_repeater/MyMesh.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ void MyMesh::onAnonDataRecv(mesh::Packet *packet, const uint8_t *secret, const m
405405
uint32_t timestamp;
406406
memcpy(&timestamp, data, 4);
407407

408+
data[len] = 0; // ensure null terminator
408409
uint8_t reply_len = handleLoginReq(sender, secret, timestamp, &data[4]);
409410

410411
if (reply_len == 0) return; // invalid request

0 commit comments

Comments
 (0)