]> The Tcpdump Group git mirrors - tcpdump/commitdiff
domain: make sure the URI RR has a length of at least 4 bytes.
authorGuy Harris <[email protected]>
Sat, 24 Feb 2024 23:39:21 +0000 (15:39 -0800)
committerGuy Harris <[email protected]>
Thu, 29 Feb 2024 02:01:29 +0000 (18:01 -0800)
(cherry picked from commit 714b3cb5b0ea692362fb9231149f8d44c668c392)

print-domain.c

index d98cd11c00544198eb8c320c570e8e2346f57756..d93aee73b254b65014563a75ad45a38e6243322d 100644 (file)
@@ -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