aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dcerpc.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2014-07-31 13:18:21 -0400
committerAnders Broman <a.broman58@gmail.com>2014-08-01 09:32:30 +0000
commita644744fb9502971fee751b8a1e390d255b82d78 (patch)
tree5bf51e3eccfee59167b1ad557762c3236f7bfc31 /epan/dissectors/packet-dcerpc.c
parentdc9b44c5e216ddd8fca54e8a2d2b0387a54f1f83 (diff)
Use packet_scope instead of a stack local
As clang pointed out we end up storing a reference to it in a global and (more relevantly) pushing that global to a tap which would run after the current frame has returned. Thanks to Alexis for bringing this to my attention. Change-Id: I3aac43a806d217b0dc8a973f6bb2fa48cdd041bb Reviewed-on: https://code.wireshark.org/review/3289 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-dcerpc.c')
-rw-r--r--epan/dissectors/packet-dcerpc.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c
index 1d7758fba4..a090c96397 100644
--- a/epan/dissectors/packet-dcerpc.c
+++ b/epan/dissectors/packet-dcerpc.c
@@ -5379,7 +5379,7 @@ dissect_dcerpc_dg_rqst(tvbuff_t *tvb, int offset, packet_info *pinfo,
e_dce_dg_common_hdr_t *hdr, conversation_t *conv)
{
dcerpc_info *di;
- dcerpc_call_value *value, v;
+ dcerpc_call_value *value;
dcerpc_matched_key matched_key, *new_matched_key;
proto_item *pi;
proto_item *parent_pi;
@@ -5421,16 +5421,16 @@ dissect_dcerpc_dg_rqst(tvbuff_t *tvb, int offset, packet_info *pinfo,
matched_key.call_id = hdr->seqnum;
value = (dcerpc_call_value *)g_hash_table_lookup(dcerpc_matched, &matched_key);
if (!value) {
- v.uuid = hdr->if_id;
- v.ver = hdr->if_ver;
- v.object_uuid = hdr->obj_id;
- v.opnum = hdr->opnum;
- v.req_frame = pinfo->fd->num;
- v.rep_frame = 0;
- v.max_ptr = 0;
- v.se_data = NULL;
- v.private_data = NULL;
- value = &v;
+ value = wmem_new(wmem_packet_scope(), dcerpc_call_value);
+ value->uuid = hdr->if_id;
+ value->ver = hdr->if_ver;
+ value->object_uuid = hdr->obj_id;
+ value->opnum = hdr->opnum;
+ value->req_frame = pinfo->fd->num;
+ value->rep_frame = 0;
+ value->max_ptr = 0;
+ value->se_data = NULL;
+ value->private_data = NULL;
}
di->conv = conv;
@@ -5457,7 +5457,7 @@ dissect_dcerpc_dg_resp(tvbuff_t *tvb, int offset, packet_info *pinfo,
e_dce_dg_common_hdr_t *hdr, conversation_t *conv)
{
dcerpc_info *di;
- dcerpc_call_value *value, v;
+ dcerpc_call_value *value;
dcerpc_matched_key matched_key, *new_matched_key;
proto_item *pi;
proto_item *parent_pi;
@@ -5486,15 +5486,15 @@ dissect_dcerpc_dg_resp(tvbuff_t *tvb, int offset, packet_info *pinfo,
matched_key.call_id = hdr->seqnum;
value = (dcerpc_call_value *)g_hash_table_lookup(dcerpc_matched, &matched_key);
if (!value) {
- v.uuid = hdr->if_id;
- v.ver = hdr->if_ver;
- v.object_uuid = hdr->obj_id;
- v.opnum = hdr->opnum;
- v.req_frame = 0;
- v.rep_frame = pinfo->fd->num;
- v.se_data = NULL;
- v.private_data = NULL;
- value = &v;
+ value = wmem_new(wmem_packet_scope(), dcerpc_call_value);
+ value->uuid = hdr->if_id;
+ value->ver = hdr->if_ver;
+ value->object_uuid = hdr->obj_id;
+ value->opnum = hdr->opnum;
+ value->req_frame = 0;
+ value->rep_frame = pinfo->fd->num;
+ value->se_data = NULL;
+ value->private_data = NULL;
}
di->conv = conv;