diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:52:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-19 04:52:31 +0000 |
commit | 31cd589d20ba8d3d6b3fc4fccacc40d38a163c5d (patch) | |
tree | 99d6c086833d530e5d1d33a8128961f8149843f0 /print-smb.c | |
parent | Adding upstream version 4.99.4. (diff) | |
download | tcpdump-ddb52baf9b7e43d90d652aef109200fa63ba0497.tar.xz tcpdump-ddb52baf9b7e43d90d652aef109200fa63ba0497.zip |
Adding upstream version 4.99.5.upstream/4.99.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'print-smb.c')
-rw-r--r-- | print-smb.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/print-smb.c b/print-smb.c index bcd7363..46dd2ef 100644 --- a/print-smb.c +++ b/print-smb.c @@ -8,9 +8,7 @@ /* \summary: SMB/CIFS printer */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif #include "netdissect-stdinc.h" @@ -414,7 +412,8 @@ print_negprot(netdissect_options *ndo, smb_fdata(ndo, words + 1, f1, ND_MIN(words + 1 + wct * 2, maxbuf), unicodestr); else - smb_data_print(ndo, words + 1, ND_MIN(wct * 2, ND_BYTES_BETWEEN(maxbuf, words + 1))); + smb_data_print(ndo, words + 1, + ND_MIN(wct * 2, ND_BYTES_BETWEEN(words + 1, maxbuf))); bcc = GET_LE_U_2(data); ND_PRINT("smb_bcc=%u\n", bcc); @@ -424,7 +423,7 @@ print_negprot(netdissect_options *ndo, maxbuf), unicodestr); else smb_data_print(ndo, data + 2, - ND_MIN(GET_LE_U_2(data), ND_BYTES_BETWEEN(maxbuf, data + 2))); + ND_MIN(GET_LE_U_2(data), ND_BYTES_BETWEEN(data + 2, maxbuf))); } } @@ -454,7 +453,8 @@ print_sesssetup(netdissect_options *ndo, smb_fdata(ndo, words + 1, f1, ND_MIN(words + 1 + wct * 2, maxbuf), unicodestr); else - smb_data_print(ndo, words + 1, ND_MIN(wct * 2, ND_BYTES_BETWEEN(maxbuf, words + 1))); + smb_data_print(ndo, words + 1, + ND_MIN(wct * 2, ND_BYTES_BETWEEN(words + 1, maxbuf))); bcc = GET_LE_U_2(data); ND_PRINT("smb_bcc=%u\n", bcc); @@ -464,7 +464,7 @@ print_sesssetup(netdissect_options *ndo, maxbuf), unicodestr); else smb_data_print(ndo, data + 2, - ND_MIN(GET_LE_U_2(data), ND_BYTES_BETWEEN(maxbuf, data + 2))); + ND_MIN(GET_LE_U_2(data), ND_BYTES_BETWEEN(data + 2, maxbuf))); } } @@ -499,7 +499,7 @@ print_lockingandx(netdissect_options *ndo, maxbuf), unicodestr); else smb_data_print(ndo, data + 2, - ND_MIN(GET_LE_U_2(data), ND_BYTES_BETWEEN(maxbuf, data + 2))); + ND_MIN(GET_LE_U_2(data), ND_BYTES_BETWEEN(data + 2, maxbuf))); } } @@ -871,7 +871,8 @@ print_smb(netdissect_options *ndo, } else { if (bcc > 0) { ND_PRINT("smb_buf[]=\n"); - smb_data_print(ndo, data + 2, ND_MIN(bcc, ND_BYTES_BETWEEN(maxbuf, data + 2))); + smb_data_print(ndo, data + 2, + ND_MIN(bcc, ND_BYTES_BETWEEN(data + 2, maxbuf))); } } } @@ -1194,7 +1195,8 @@ nbt_udp137_print(netdissect_options *ndo, } else { if (p >= maxbuf) goto out; - smb_data_print(ndo, p, ND_MIN(rdlen, length - ND_BYTES_BETWEEN(p, data))); + smb_data_print(ndo, p, + ND_MIN(rdlen, length - ND_BYTES_BETWEEN(data, p))); p += rdlen; } } |