summaryrefslogtreecommitdiffstats
path: root/freebsd/contrib/tcpdump/print-bootp.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/contrib/tcpdump/print-bootp.c')
-rw-r--r--freebsd/contrib/tcpdump/print-bootp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/freebsd/contrib/tcpdump/print-bootp.c b/freebsd/contrib/tcpdump/print-bootp.c
index c9f687ff..3166ca10 100644
--- a/freebsd/contrib/tcpdump/print-bootp.c
+++ b/freebsd/contrib/tcpdump/print-bootp.c
@@ -364,7 +364,7 @@ bootp_print(netdissect_options *ndo,
if (*bp->bp_sname) {
ND_PRINT((ndo, "\n\t sname \""));
if (fn_printztn(ndo, bp->bp_sname, (u_int)sizeof bp->bp_sname,
- ndo->ndo_snapend)) {
+ ndo->ndo_snapend) == 0) {
ND_PRINT((ndo, "\""));
ND_PRINT((ndo, "%s", tstr + 1));
return;
@@ -375,7 +375,7 @@ bootp_print(netdissect_options *ndo,
if (*bp->bp_file) {
ND_PRINT((ndo, "\n\t file \""));
if (fn_printztn(ndo, bp->bp_file, (u_int)sizeof bp->bp_file,
- ndo->ndo_snapend)) {
+ ndo->ndo_snapend) == 0) {
ND_PRINT((ndo, "\""));
ND_PRINT((ndo, "%s", tstr + 1));
return;
@@ -384,7 +384,7 @@ bootp_print(netdissect_options *ndo,
}
/* Decode the vendor buffer */
- ND_TCHECK(bp->bp_vend[0]);
+ ND_TCHECK2(bp->bp_vend[0], 4);
if (memcmp((const char *)bp->bp_vend, vm_rfc1048,
sizeof(uint32_t)) == 0)
rfc1048_print(ndo, bp->bp_vend);
@@ -394,6 +394,7 @@ bootp_print(netdissect_options *ndo,
else {
uint32_t ul;
+ ND_TCHECK_32BITS(&bp->bp_vend);
ul = EXTRACT_32BITS(&bp->bp_vend);
if (ul != 0)
ND_PRINT((ndo, "\n\t Vendor-#0x%x", ul));