aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2019-01-25 18:29:34 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2019-01-26 10:51:39 +0000
commit14d5ab01c0a0486272d65d3f592e8aed309054dd (patch)
tree145791f9629b3bad4f8420b375be4a5f6fa149e1 /epan
parent6fbf28f3b8659b835a608e81fc97acfd797042b6 (diff)
SMB2: ensure that preauth_hash_current pointer is always initialized
Bug: 15446 Change-Id: I9c233ee327dd40d1ae2dd076a2e236c6f23ae5e2 Reviewed-on: https://code.wireshark.org/review/31741 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-smb2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/epan/dissectors/packet-smb2.c b/epan/dissectors/packet-smb2.c
index 038ff36172..132c3a9f02 100644
--- a/epan/dissectors/packet-smb2.c
+++ b/epan/dissectors/packet-smb2.c
@@ -4516,9 +4516,6 @@ dissect_smb2_negotiate_protocol_request(tvbuff_t *tvb, packet_info *pinfo, proto
/* compute preauth hash on first pass */
if (!pinfo->fd->visited && ssi) {
ssi->preauth_hash_req = (guint8*)wmem_alloc0(wmem_file_scope(), SMB2_PREAUTH_HASH_SIZE);
- memset(si->conv->preauth_hash_ses, 0, SMB2_PREAUTH_HASH_SIZE);
- memset(si->conv->preauth_hash_con, 0, SMB2_PREAUTH_HASH_SIZE);
- si->conv->preauth_hash_current = si->conv->preauth_hash_con;
update_preauth_hash(si->conv->preauth_hash_current, tvb);
memcpy(ssi->preauth_hash_req, si->conv->preauth_hash_current, SMB2_PREAUTH_HASH_SIZE);
}
@@ -9308,7 +9305,7 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea
/* no smb2_into_t structure for this conversation yet,
* create it.
*/
- si->conv = wmem_new(wmem_file_scope(), smb2_conv_info_t);
+ si->conv = wmem_new0(wmem_file_scope(), smb2_conv_info_t);
/* qqq this leaks memory for now since we never free
the hashtables */
si->conv->matched = g_hash_table_new(smb2_saved_info_hash_matched,
@@ -9320,6 +9317,7 @@ dissect_smb2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, gboolea
si->conv->fids = g_hash_table_new(smb2_fid_info_hash,
smb2_fid_info_equal);
si->conv->files = g_hash_table_new(smb2_eo_files_hash,smb2_eo_files_equal);
+ si->conv->preauth_hash_current = si->conv->preauth_hash_con;
/* Bit of a hack to avoid leaking the hash tables - register a
* callback to free them. Ideally wmem would implement a simple