From: Guy Harris Date: Sat, 14 Jan 2017 10:04:20 +0000 (-0800) Subject: Make sure we have the entire option before printing it. X-Git-Tag: tcpdump-4.9.0-bp~11 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/e7f2e5fdab1dd0eb44eed21410a33bd4e7972ef2?ds=inline Make sure we have the entire option before printing it. --- diff --git a/print-dhcp6.c b/print-dhcp6.c index 16f82542..78b82ee3 100644 --- a/print-dhcp6.c +++ b/print-dhcp6.c @@ -304,6 +304,7 @@ dhcp6opt_print(netdissect_options *ndo, goto trunc; opttype = EXTRACT_16BITS(&dh6o->dh6opt_type); ND_PRINT((ndo, " (%s", tok2str(dh6opt_str, "opt_%u", opttype))); + ND_TCHECK2(*(cp + sizeof(*dh6o)), optlen); switch (opttype) { case DH6OPT_CLIENTID: case DH6OPT_SERVERID: