A fix for bug 4301:

Check sip->extra_info for SMB_EI_NTI before usage.

svn path=/trunk/; revision=31187
This commit is contained in:
Stig Bjørlykke 2009-12-07 15:07:38 +00:00
parent 82e8cfe421
commit 7aa873dae6
2 changed files with 7 additions and 5 deletions

View File

@ -8443,7 +8443,7 @@ dissect_nt_trans_setup_request(tvbuff_t *tvb, packet_info *pinfo, int offset, pr
proto_tree *tree = NULL;
int old_offset = offset;
smb_info_t *si;
smb_nt_transact_info_t *nti;
smb_nt_transact_info_t *nti = NULL;
smb_saved_info_t *sip;
@ -8451,8 +8451,9 @@ dissect_nt_trans_setup_request(tvbuff_t *tvb, packet_info *pinfo, int offset, pr
DISSECTOR_ASSERT(si);
sip = si->sip;
DISSECTOR_ASSERT(sip);
nti=sip->extra_info;
if (sip->extra_info_type == SMB_EI_NTI) {
nti=sip->extra_info;
}
if(parent_tree){
tvb_ensure_bytes_exist(tvb, offset, len);
@ -8469,7 +8470,7 @@ dissect_nt_trans_setup_request(tvbuff_t *tvb, packet_info *pinfo, int offset, pr
guint16 fid;
/* function code */
offset = dissect_smb2_ioctl_function(tvb, pinfo, tree, offset, &nti->ioctl_function);
offset = dissect_smb2_ioctl_function(tvb, pinfo, tree, offset, nti ? &nti->ioctl_function : NULL);
/* fid */
fid = tvb_get_letohs(tvb, offset);

View File

@ -951,7 +951,8 @@ dissect_smb2_ioctl_function(tvbuff_t *tvb, packet_info *pinfo, proto_tree *paren
}
ioctl_function=tvb_get_letohl(tvb, offset);
*ioctlfunc=ioctl_function;
if (ioctlfunc)
*ioctlfunc=ioctl_function;
if(ioctl_function){
/* device */
proto_tree_add_item(tree, hf_smb2_ioctl_function_device, tvb, offset, 4, TRUE);