]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-atalk.c
CVE-2017-13040/MPTCP: Clean up printing DSS suboption.
[tcpdump] / print-atalk.c
index 8460a4fd1cd8a74edcf7a7e04a7ec3d3e733b050..9d7d69d3d790189f01ca5d430980b98d021d2ac4 100644 (file)
@@ -216,6 +216,15 @@ aarp_print(netdissect_options *ndo,
 
        ND_PRINT((ndo, "aarp "));
        ap = (const struct aarp *)bp;
+       if (!ND_TTEST(*ap)) {
+               /* Just bail if we don't have the whole chunk. */
+               ND_PRINT((ndo, " [|aarp]"));
+               return;
+       }
+       if (length < sizeof(*ap)) {
+               ND_PRINT((ndo, " [|aarp %u]", length));
+               return;
+       }
        if (EXTRACT_16BITS(&ap->htype) == 1 &&
            EXTRACT_16BITS(&ap->ptype) == ETHERTYPE_ATALK &&
            ap->halen == 6 && ap->palen == 4 )