Skip to content

Commit

Permalink
Don't directly use buffer set in sbuff (CID #1634622)
Browse files Browse the repository at this point in the history
Another case of an uninitialized local buffer used in an sbuff but
referenced by name to print out. Coverity complains about it, not
recognizing the the sbuff operation puts a value there. Referencing
the start of the sbuff gets the same effect without complaint.
  • Loading branch information
jejones3141 committed Nov 13, 2024
1 parent fb31ac2 commit 1542e8f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/bin/dhcpclient.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,13 @@ static void dhcp_packet_debug(fr_packet_t *packet, fr_pair_list_t *list, bool re
for (vp = fr_pair_list_head(list);
vp;
vp = fr_pair_list_next(list, vp)) {
fr_sbuff_t out;

PAIR_VERIFY(vp);

(void) fr_pair_print(&FR_SBUFF_OUT(buffer, sizeof(buffer)), NULL, vp);
printf("\t%s\n", buffer);
out = FR_SBUFF_OUT(buffer, sizeof(buffer));
(void) fr_pair_print(&out, NULL, vp);
printf("\t%s\n", fr_sbuff_start(&out));
}
}

Expand Down

0 comments on commit 1542e8f

Please sign in to comment.