]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ldp.c
SMB: Add two missing bounds checks
[tcpdump] / print-ldp.c
index 653ea37cbd5135018a54480aa67e63ccf0386b78..680a7e1e8fc135824dc746e4f367f0c7a83bc579 100644 (file)
@@ -236,7 +236,7 @@ static int ldp_pdu_print(netdissect_options *, const u_char *);
 static u_int
 ldp_tlv_print(netdissect_options *ndo,
               const u_char *tptr,
-              u_short msg_tlen)
+              u_int msg_tlen)
 {
     struct ldp_tlv_header {
         nd_uint16_t type;
@@ -253,7 +253,7 @@ ldp_tlv_print(netdissect_options *ndo,
     ldp_tlv_header = (const struct ldp_tlv_header *)tptr;
     ND_TCHECK_SIZE(ldp_tlv_header);
     tlv_len=GET_BE_U_2(ldp_tlv_header->length);
-    if (tlv_len + 4 > msg_tlen) {
+    if (tlv_len + 4U > msg_tlen) {
         ND_PRINT("\n\t\t TLV contents go past end of message");
         return 0;
     }