Skip to content

Commit

Permalink
Fix wrong length check in message parser.
Browse files Browse the repository at this point in the history
Thanks to zmw12306.
  • Loading branch information
jech committed Jul 16, 2023
1 parent 97b7187 commit 417024f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion message.c
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ preparse_packet(const unsigned char *from, struct interface *ifp,
i++;
continue;
}
if(i + 1 > bodylen) {
if(i + 2 > bodylen) {
fprintf(stderr, "Received truncated message.\n");
break;
}
Expand Down

0 comments on commit 417024f

Please sign in to comment.