diff options
author | Philip Paeps <philip@FreeBSD.org> | 2019-10-06 04:36:53 +0000 |
---|---|---|
committer | Philip Paeps <philip@FreeBSD.org> | 2019-10-06 04:36:53 +0000 |
commit | f91036a44a189fa5d0b5f1c6dea0a396a0f928c0 (patch) | |
tree | 2cd0554d9f0826a4e0bc63c5e4ca83ece65bee24 /print-smb.c | |
parent | 810711ec13a9424633df50e0a1af057a68e2ed45 (diff) |
Notes
Diffstat (limited to 'print-smb.c')
-rw-r--r-- | print-smb.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/print-smb.c b/print-smb.c index 723b9a032415c..944b8d28abfc0 100644 --- a/print-smb.c +++ b/print-smb.c @@ -371,16 +371,21 @@ print_trans(netdissect_options *ndo, ND_PRINT((ndo, "smb_bcc=%u\n", bcc)); if (bcc > 0) { smb_fdata(ndo, data1 + 2, f2, maxbuf - (paramlen + datalen), unicodestr); - - if (strcmp((const char *)(data1 + 2), "\\MAILSLOT\\BROWSE") == 0) { +#define MAILSLOT_BROWSE_STR "\\MAILSLOT\\BROWSE" + ND_TCHECK2(*(data1 + 2), strlen(MAILSLOT_BROWSE_STR) + 1); + if (strcmp((const char *)(data1 + 2), MAILSLOT_BROWSE_STR) == 0) { print_browse(ndo, param, paramlen, data, datalen); return; } +#undef MAILSLOT_BROWSE_STR - if (strcmp((const char *)(data1 + 2), "\\PIPE\\LANMAN") == 0) { +#define PIPE_LANMAN_STR "\\PIPE\\LANMAN" + ND_TCHECK2(*(data1 + 2), strlen(PIPE_LANMAN_STR) + 1); + if (strcmp((const char *)(data1 + 2), PIPE_LANMAN_STR) == 0) { print_ipc(ndo, param, paramlen, data, datalen); return; } +#undef PIPE_LANMAN_STR if (paramlen) smb_fdata(ndo, param, f3, min(param + paramlen, maxbuf), unicodestr); @@ -940,7 +945,9 @@ nbt_tcp_print(netdissect_options *ndo, if (caplen < 4) goto trunc; maxbuf = data + caplen; + ND_TCHECK_8BITS(data); type = data[0]; + ND_TCHECK_16BITS(data + 2); nbt_len = EXTRACT_16BITS(data + 2); length -= 4; caplen -= 4; |