X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/4aac37f04316b37b73b99bdcdbfa97347bb2fe51..9169e4e1949c3fa879f0a2f98cfbd8c444743c27:/smbutil.c diff --git a/smbutil.c b/smbutil.c index a8203bf6..ff32ecce 100644 --- a/smbutil.c +++ b/smbutil.c @@ -145,7 +145,6 @@ name_interpret(netdissect_options *ndo, if (in >= maxbuf) return(-1); /* name goes past the end of the buffer */ - ND_TCHECK_1(in); len = GET_U_1(in) / 2; in++; @@ -190,7 +189,6 @@ name_ptr(netdissect_options *ndo, p = buf + ofs; if (p >= maxbuf) return(NULL); /* name goes past the end of the buffer */ - ND_TCHECK_1(p); c = GET_U_1(p); @@ -244,14 +242,12 @@ name_len(netdissect_options *ndo, if (s >= maxbuf) return(-1); /* name goes past the end of the buffer */ - ND_TCHECK_1(s); c = GET_U_1(s); if ((c & 0xC0) == 0xC0) return(2); while (GET_U_1(s)) { if (s >= maxbuf) return(-1); /* name goes past the end of the buffer */ - ND_TCHECK_1(s); s += GET_U_1(s) + 1; ND_TCHECK_1(s); } @@ -296,7 +292,6 @@ smb_data_print(netdissect_options *ndo, const u_char *buf, u_int len) return; ND_PRINT("[%03X] ", i); for (i = 0; i < len; /*nothing*/) { - ND_TCHECK_1(buf + i); ND_PRINT("%02X ", GET_U_1(buf + i) & 0xff); i++; if (i%8 == 0) @@ -320,7 +315,7 @@ smb_data_print(netdissect_options *ndo, const u_char *buf, u_int len) while (n--) ND_PRINT(" "); - n = min(8, i % 16); + n = ND_MIN(8, i % 16); print_asc(ndo, buf + i - (i % 16), n); ND_PRINT(" "); n = (i % 16) - n; @@ -328,10 +323,6 @@ smb_data_print(netdissect_options *ndo, const u_char *buf, u_int len) print_asc(ndo, buf + i - n, n); ND_PRINT("\n"); } - return; - -trunc: - nd_print_trunc(ndo); } @@ -380,7 +371,6 @@ unistr(netdissect_options *ndo, char (*buf)[MAX_UNISTR_SIZE+1], sp = s; if (!use_unicode) { for (;;) { - ND_TCHECK_1(sp); c = GET_U_1(sp); sp++; strsize++; @@ -389,7 +379,6 @@ unistr(netdissect_options *ndo, char (*buf)[MAX_UNISTR_SIZE+1], } } else { for (;;) { - ND_TCHECK_2(sp); c = GET_LE_U_2(sp); sp += 2; strsize += 2; @@ -400,7 +389,6 @@ unistr(netdissect_options *ndo, char (*buf)[MAX_UNISTR_SIZE+1], } if (!use_unicode) { while (strsize != 0) { - ND_TCHECK_1(s); c = GET_U_1(s); s++; strsize--; @@ -432,7 +420,6 @@ unistr(netdissect_options *ndo, char (*buf)[MAX_UNISTR_SIZE+1], } } else { while (strsize > 1) { - ND_TCHECK_2(s); c = GET_LE_U_2(s); s += 2; strsize -= 2; @@ -488,14 +475,12 @@ smb_fdata1(netdissect_options *ndo, while (*fmt && buf