X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/83a7bda4103699b30270c3bee2b796811e9792e6..69ead2a09cf7d0666c6a7ac12e47fd9743242c61:/print-atalk.c diff --git a/print-atalk.c b/print-atalk.c index 8460a4fd..a5ce58a4 100644 --- a/print-atalk.c +++ b/print-atalk.c @@ -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 )