Skip to content

Commit

Permalink
dns/rr: fix dns_rr_print underflow
Browse files Browse the repository at this point in the history
found by coverity
  • Loading branch information
sreimers committed Jul 23, 2024
1 parent 32404d8 commit d63bb23
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dns/rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,10 @@ int dns_rr_print(struct re_printf *pf, const struct dnsrr *rr)
n = (w > l) ? w - l : 0;

err = re_hprintf(pf, "%s.", rr->name);
while (n--)
while (n) {
err |= pf->vph(" ", 1, pf->arg);
--n;
}

err |= re_hprintf(pf, " %10lld %-4s %-7s ",
rr->ttl,
Expand Down

0 comments on commit d63bb23

Please sign in to comment.