]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Ethernet: Add a bounds check
authorFrancois-Xavier Le Bail <[email protected]>
Thu, 6 May 2021 11:39:10 +0000 (13:39 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Thu, 6 May 2021 11:50:55 +0000 (13:50 +0200)
Avoid to have p (current pointer on packet data) > ndo->ndo_snapend
in isoclns_print() in some cases.

Moreover:
Add a "FIXME" comment.

print-ether.c

index 2596cd6d7bad3dad47ba0f148ef9e6b93b269af3..da95862b3c0b5150a4b324f0439caf4eb828f395 100644 (file)
@@ -564,6 +564,9 @@ ethertype_print(netdissect_options *ndo,
                        nd_print_trunc(ndo);
                        return (1);
                }
+               /* At least one byte is required */
+               /* FIXME: Reference for this byte? */
+               ND_TCHECK_LEN(p, 1);
                isoclns_print(ndo, p + 1, length - 1);
                return(1);