diff options
author | Guy Harris <guy@alum.mit.edu> | 2015-01-06 00:44:11 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2015-01-06 00:44:26 -0800 |
commit | b4498d5ab7a6dc5702084fb8a1274ce85a798cb6 (patch) | |
tree | a9e0f425c6152dfac428221dfafe4143340d5257 /print-arcnet.c | |
parent | 0e0eff9525461780796d8e60745f7105c94b0ff2 (diff) | |
download | tcpdump-b4498d5ab7a6dc5702084fb8a1274ce85a798cb6.tar.gz |
Check not just the capture length but the on-the-network length.
Diffstat (limited to 'print-arcnet.c')
-rw-r--r-- | print-arcnet.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/print-arcnet.c b/print-arcnet.c index 47d70d8b..0ffb9220 100644 --- a/print-arcnet.c +++ b/print-arcnet.c @@ -181,7 +181,7 @@ arcnet_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch u_int seqid = 0; u_char arc_type; - if (caplen < ARC_HDRLEN) { + if (caplen < ARC_HDRLEN || length < ARC_HDRLEN) { ND_PRINT((ndo, "[|arcnet]")); return (caplen); } @@ -202,14 +202,14 @@ arcnet_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_ch } if (phds) { - if (caplen < ARC_HDRNEWLEN) { + if (caplen < ARC_HDRNEWLEN || length < ARC_HDRNEWLEN) { arcnet_print(ndo, p, length, 0, 0, 0); ND_PRINT((ndo, "[|phds]")); return (caplen); } if (ap->arc_flag == 0xff) { - if (caplen < ARC_HDRNEWLEN_EXC) { + if (caplen < ARC_HDRNEWLEN_EXC || length < ARC_HDRNEWLEN_EXC) { arcnet_print(ndo, p, length, 0, 0, 0); ND_PRINT((ndo, "[|phds extended]")); return (caplen); @@ -268,7 +268,7 @@ arcnet_linux_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, cons int archdrlen = 0; u_char arc_type; - if (caplen < ARC_LINUX_HDRLEN) { + if (caplen < ARC_LINUX_HDRLEN || length < ARC_LINUX_HDRLEN) { ND_PRINT((ndo, "[|arcnet]")); return (caplen); } @@ -279,7 +279,7 @@ arcnet_linux_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, cons switch (arc_type) { default: archdrlen = ARC_LINUX_HDRNEWLEN; - if (caplen < ARC_LINUX_HDRNEWLEN) { + if (caplen < ARC_LINUX_HDRNEWLEN || length < ARC_LINUX_HDRNEWLEN) { ND_PRINT((ndo, "[|arcnet]")); return (caplen); } |