X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/d33705dab664019c1f602d8c5220288be1f49822..ebb51ef0e725737ca8c1d618da6527a58660d2bf:/print-dhcp6.c diff --git a/print-dhcp6.c b/print-dhcp6.c index 16f82542..762d9187 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: @@ -731,7 +732,7 @@ dhcp6opt_print(netdissect_options *ndo, while (remain_len && *tp) { label_len = *tp++; if (label_len < remain_len - 1) { - fn_printn(ndo, tp, label_len, NULL); + (void)fn_printn(ndo, tp, label_len, NULL); tp += label_len; remain_len -= (label_len + 1); if(*tp) ND_PRINT((ndo, ".")); @@ -751,7 +752,7 @@ dhcp6opt_print(netdissect_options *ndo, } tp = (const u_char *)(dh6o + 1); ND_PRINT((ndo, "=")); - fn_printn(ndo, tp, (u_int)optlen, NULL); + (void)fn_printn(ndo, tp, (u_int)optlen, NULL); ND_PRINT((ndo, ")")); break;