From: Guy Harris Date: Sat, 24 Feb 2024 23:39:21 +0000 (-0800) Subject: domain: make sure the URI RR has a length of at least 4 bytes. X-Git-Tag: tcpdump-4.99.5~101 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/93b107bb867df020b059eff1d3ce3c2fa3f6196a domain: make sure the URI RR has a length of at least 4 bytes. (cherry picked from commit 714b3cb5b0ea692362fb9231149f8d44c668c392) --- diff --git a/print-domain.c b/print-domain.c index d98cd11c..d93aee73 100644 --- a/print-domain.c +++ b/print-domain.c @@ -839,6 +839,7 @@ ns_rprint(netdissect_options *ndo, case T_URI: if (!ND_TTEST_LEN(cp, len)) return(NULL); + ND_ICHECK_U(len, <, 4); ND_PRINT(" %u %u ", GET_BE_U_2(cp), GET_BE_U_2(cp + 2)); if (nd_printn(ndo, cp + 4, len - 4, ndo->ndo_snapend)) return(NULL); @@ -894,6 +895,8 @@ ns_rprint(netdissect_options *ndo, } } return (rp); /* XXX This isn't always right */ +invalid: + nd_print_invalid(ndo); } void