Skip to content

Commit

Permalink
proto_ipv4: Make netsniff detect and properly handle some malformed p…
Browse files Browse the repository at this point in the history
…ackets

Entails the potential integer underflow of a signed integer.

Signed-off-by: Nathaniel Ferguson <[email protected]>
Signed-off-by: Tobias Klauser <[email protected]>
  • Loading branch information
nathaniellives authored and tklauser committed May 4, 2020
1 parent 21b9cc3 commit 9d71c0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proto_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static void ipv4(struct pkt_buff *pkt)
* check and handle that
*/
opt_len = *(++opt);
if (opt_len > opts_len) {
if (opt_len < 2 || opt_len > opts_len) {
tprintf(", Len (%zd, invalid) ]\n", opt_len);
goto out;
} else
Expand Down

0 comments on commit 9d71c0f

Please sign in to comment.