aboutsummaryrefslogtreecommitdiffstats
path: root/print-domain.c
diff options
context:
space:
mode:
authorPhilip Paeps <philip@FreeBSD.org>2019-10-06 04:36:53 +0000
committerPhilip Paeps <philip@FreeBSD.org>2019-10-06 04:36:53 +0000
commitf91036a44a189fa5d0b5f1c6dea0a396a0f928c0 (patch)
tree2cd0554d9f0826a4e0bc63c5e4ca83ece65bee24 /print-domain.c
parent810711ec13a9424633df50e0a1af057a68e2ed45 (diff)
downloadsrc-vendor/tcpdump.tar.gz
src-vendor/tcpdump.zip
Vendor import of tcpdump 4.9.3vendor/tcpdump
Notes
Notes: svn path=/vendor/tcpdump/dist/; revision=353144
Diffstat (limited to 'print-domain.c')
-rw-r--r--print-domain.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/print-domain.c b/print-domain.c
index 9a2b9e85687b..e29a9b4b0f9b 100644
--- a/print-domain.c
+++ b/print-domain.c
@@ -582,6 +582,13 @@ ns_print(netdissect_options *ndo,
register const u_char *cp;
uint16_t b2;
+ if(length < sizeof(*np)) {
+ ND_PRINT((ndo, "domain"));
+ ND_PRINT((ndo, " [length %u < %zu]", length, sizeof(*np)));
+ ND_PRINT((ndo, " (invalid)"));
+ return;
+ }
+
np = (const HEADER *)bp;
ND_TCHECK(*np);
/* get the byte-order right */