Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
domain: handle too-short URI RRs correctly.
Browse files Browse the repository at this point in the history
Just report the problem and drive on, not trying to print the contents.

(cherry picked from commit 63f7206)
  • Loading branch information
guyharris committed Feb 29, 2024
1 parent 93b107b commit 1f563c1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions print-domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,10 @@ ns_rprint(netdissect_options *ndo,
case T_URI:
if (!ND_TTEST_LEN(cp, len))
return(NULL);
ND_ICHECK_U(len, <, 4);
if (len < 4) {
ND_PRINT(" len %u is too short (< 4)", len);
break;
}
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);
Expand Down Expand Up @@ -895,8 +898,6 @@ ns_rprint(netdissect_options *ndo,
}
}
return (rp); /* XXX This isn't always right */
invalid:
nd_print_invalid(ndo);
}

void
Expand Down

0 comments on commit 1f563c1

Please sign in to comment.