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 11:01:59 -0800 |
commit | 1c7d24703bde4d679048478cca5f6c1bb3391c1d (patch) | |
tree | b5e66172b481798d7eeaa39239de56b51a31a4f5 | |
parent | c33ee7ff380c77ec2c0dbd8fceeb16cc41c618d0 (diff) | |
download | tcpdump-1c7d24703bde4d679048478cca5f6c1bb3391c1d.tar.gz |
Check not just the capture length but the on-the-network length.
-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 cdd4a650..7fec9ac2 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); } |