Apply Jeroen Ruigrok van der Werven's patches ...

svn path=/trunk/; revision=2699
This commit is contained in:
Richard Sharpe 2000-11-22 21:19:38 +00:00
parent b4219afa51
commit 07f065e61a
3 changed files with 15 additions and 14 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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) {