]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bootp.c
Travis CI: Revert to libpcap master branch (updated)
[tcpdump] / print-bootp.c
index d87911fdb206af48ffeffec146f849f48d9c175c..c076f4250756e241ffa6333fd2dfdf33dcefca77 100644 (file)
@@ -358,7 +358,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;
@@ -369,7 +369,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;
@@ -378,7 +378,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);
@@ -388,6 +388,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));