aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packet-smb-mailslot.c13
-rw-r--r--packet-smb-pipe.c4
-rw-r--r--packet-smb.c12
3 files changed, 15 insertions, 14 deletions
diff --git a/packet-smb-mailslot.c b/packet-smb-mailslot.c
index ebbb8f065c..d357640899 100644
--- a/packet-smb-mailslot.c
+++ b/packet-smb-mailslot.c
@@ -2,7 +2,7 @@
* Routines for smb mailslot packet dissection
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com>
*
- * $Id: packet-smb-mailslot.c,v 1.7 2000/11/19 08:54:06 guy Exp $
+ * $Id: packet-smb-mailslot.c,v 1.8 2000/11/22 21:19:37 sharpe Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -141,14 +141,14 @@ dissect_mailslot_smb(const u_char *pd, int offset, frame_data *fd,
/*** Decide what dissector to call based upon the command value ***/
- if (strcmp(command, "BROWSE") == 0) { /* Decode a browse */
+ if (command != NULL && strcmp(command, "BROWSE") == 0) { /* Decode a browse */
return dissect_mailslot_browse(pd, offset, fd, parent, tree,
si, max_data, SMB_offset, errcode, dirn, command,
DataOffset, DataCount);
}
- else if (strcmp(command, "LANMAN") == 0) {
+ else if (command != NULL && strcmp(command, "LANMAN") == 0) {
return dissect_pipe_lanman(pd, offset, fd, parent, tree, si,
max_data, SMB_offset, errcode, dirn, command,
@@ -159,9 +159,10 @@ dissect_mailslot_smb(const u_char *pd, int offset, frame_data *fd,
/* NOTE: may need a look up list to check for the mailslot names passed */
/* by the logon request packet */
- else if ((strncmp(command, "NET", strlen("NET")) == 0)
- || (strcmp(command, "TEMP\\NETLOGON") == 0)
- || (strcmp(command, "MSSP") == 0)){
+ else if (((command != NULL) &&
+ strncmp(command, "NET", strlen("NET")) == 0) ||
+ (strcmp(command, "TEMP\\NETLOGON") == 0) ||
+ (strcmp(command, "MSSP") == 0)){
return dissect_smb_logon(pd, DataOffset, fd, parent, tree,
si, max_data, SMB_offset, errcode, dirn,
diff --git a/packet-smb-pipe.c b/packet-smb-pipe.c
index c6b120e8f5..06165591e1 100644
--- a/packet-smb-pipe.c
+++ b/packet-smb-pipe.c
@@ -2,7 +2,7 @@
* Routines for smb packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-smb-pipe.c,v 1.11 2000/09/11 16:16:03 gram Exp $
+ * $Id: packet-smb-pipe.c,v 1.12 2000/11/22 21:19:37 sharpe Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1231,7 +1231,7 @@ dissect_pipe_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *paren
if (!proto_is_protocol_enabled(proto_smb_lanman))
return 0;
- if (strcmp(command, "LANMAN") == 0) { /* Try to decode a LANMAN */
+ if (command != NULL && strcmp(command, "LANMAN") == 0) { /* Try to decode a LANMAN */
return dissect_pipe_lanman(pd, offset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, command, DataOffset, DataCount, ParameterOffset, ParameterCount);
diff --git a/packet-smb.c b/packet-smb.c
index 3f836aa104..f0a49ad90f 100644
--- a/packet-smb.c
+++ b/packet-smb.c
@@ -2,7 +2,7 @@
* Routines for smb packet dissection
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
*
- * $Id: packet-smb.c,v 1.74 2000/11/19 08:54:06 guy Exp $
+ * $Id: packet-smb.c,v 1.75 2000/11/22 21:19:38 sharpe Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -9507,14 +9507,14 @@ dissect_transact_params(const u_char *pd, int offset, frame_data *fd, proto_tree
if (!TransactName)
return;
- TransactNameCopy = g_malloc(strlen(TransactName) + 1);
+ TransactNameCopy = g_malloc(TransactName ? strlen(TransactName) + 1 : 1);
/* Should check for error here ... */
- strcpy(TransactNameCopy, TransactName);
+ strcpy(TransactNameCopy, TransactName ? TransactName : "");
if (TransactNameCopy[0] == '\\') {
trans_type = TransactNameCopy + 1; /* Skip the slash */
- loc_of_slash = strchr(trans_type, '\\');
+ loc_of_slash = trans_type ? strchr(trans_type, '\\') : NULL;
}
if (loc_of_slash) {
@@ -9526,9 +9526,9 @@ dissect_transact_params(const u_char *pd, int offset, frame_data *fd, proto_tree
trans_cmd = NULL;
if ((trans_cmd == NULL) ||
- (((strcmp(trans_type, "MAILSLOT") != 0) ||
+ (((trans_type == NULL || strcmp(trans_type, "MAILSLOT") != 0) ||
!dissect_mailslot_smb(pd, SetupAreaOffset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, trans_cmd, SMB_offset + DataOffset, DataCount, SMB_offset + ParameterOffset, ParameterCount)) &&
- ((strcmp(trans_type, "PIPE") != 0) ||
+ ((trans_type == NULL || strcmp(trans_type, "PIPE") != 0) ||
!dissect_pipe_smb(pd, offset, fd, parent, tree, si, max_data, SMB_offset, errcode, dirn, trans_cmd, DataOffset, DataCount, ParameterOffset, ParameterCount)))) {
if (ParameterCount > 0) {