Skip to content

Commit e2a618e

Browse files
committed
Clarify bounds check comment in Packet::readFrom
1 parent f2f5021 commit e2a618e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Packet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ bool Packet::readFrom(const uint8_t src[], uint8_t len) {
6767
uint8_t i = 0;
6868
header = src[i++];
6969
if (hasTransportCodes()) {
70-
if (i + 4 >= len) return false; // need 4 bytes for transport codes + path_len after
70+
if (i + 4 >= len) return false; // need 4 transport bytes + the path_len byte
7171
memcpy(&transport_codes[0], &src[i], 2); i += 2;
7272
memcpy(&transport_codes[1], &src[i], 2); i += 2;
7373
} else {

0 commit comments

Comments
 (0)