If conversations have already been created in lower layers, say TCP before

SMB sees the PDU, then SMB would forget to create the proper state variables and crash.

SMB is changed to split the operation into
1, only create a conversation if it needs to. (as before)
2, detect if it needs to create the si.ct state variables independant of
whether smb also created a conversation or not.

Without this patch and with changes to say TCP to create conversations ethereal would crash at the first packet the SMB dissector would see.

svn path=/trunk/; revision=5906
This commit is contained in:
Ronnie Sahlberg 2002-07-27 03:18:29 +00:00
parent 6d68a964e5
commit 0fa3c02231
1 changed files with 8 additions and 8 deletions

View File

@ -3,7 +3,7 @@
* Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com>
* 2001 Rewrite by Ronnie Sahlberg and Guy Harris
*
* $Id: packet-smb.c,v 1.272 2002/07/20 23:14:35 guy Exp $
* $Id: packet-smb.c,v 1.273 2002/07/27 03:18:29 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -15238,15 +15238,15 @@ dissect_smb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree)
conversation*/
conversation = find_conversation(&pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
if(conversation){
si.ct=conversation_get_proto_data(conversation, proto_smb);
} else {
/* OK this is a new conversation, we must create it
and attach appropriate data (matched and unmatched
table for this conversation)
*/
if(!conversation){
/* OK this is a new conversation so lets create it */
conversation = conversation_new(&pinfo->src, &pinfo->dst,
pinfo->ptype, pinfo->srcport, pinfo->destport, 0);
}
/* see if we already have the smb data for this conversation */
si.ct=conversation_get_proto_data(conversation, proto_smb);
if(!si.ct){
/* No, not yet. create it and attach it to the conversation */
si.ct = g_mem_chunk_alloc(conv_tables_chunk);
conv_tables = g_slist_prepend(conv_tables, si.ct);
si.ct->matched= g_hash_table_new(smb_saved_info_hash_matched,