aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-reload-framing.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-07-21 01:24:54 +0000
committerGuy Harris <guy@alum.mit.edu>2012-07-21 01:24:54 +0000
commitbddb918dc4b94f2f3023fdf8924fcea3e2160565 (patch)
tree67240b3b1189594a78092c97585509fd458cda2f /epan/dissectors/packet-reload-framing.c
parentd6533eb467b8a3083d3e2c7a1c81a4cf8a540519 (diff)
The 32-bit-key tree code assumes that the pointer to the key can be cast
to a pointer to a guint32 and dereferenced. On some platforms, such as SPARC, this requires that the pointer be aligned on a 4-byte boundary; there is no guarantee that the data field of an address structure is aligned on a 4-byte boundary, so allocate a buffer for a copy of that data and copy the data into it, and free it when we're done with it. Should fix bug 7501. svn path=/trunk/; revision=43880
Diffstat (limited to 'epan/dissectors/packet-reload-framing.c')
-rw-r--r--epan/dissectors/packet-reload-framing.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/dissectors/packet-reload-framing.c b/epan/dissectors/packet-reload-framing.c
index c8a6157f61..1006f083f4 100644
--- a/epan/dissectors/packet-reload-framing.c
+++ b/epan/dissectors/packet-reload-framing.c
@@ -181,13 +181,15 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
transaction_id_key[1].length = 1;
transaction_id_key[1].key = &pinfo->srcport;
transaction_id_key[2].length = (pinfo->src.len)>>2;
- transaction_id_key[2].key = (void*)pinfo->src.data;
+ transaction_id_key[2].key = g_malloc(transaction_id_key[2].length);
+ memcpy(transaction_id_key[2].key, pinfo->src.data, transaction_id_key[2].length);
}
else {
transaction_id_key[1].length = 1;
transaction_id_key[1].key = &pinfo->destport;
transaction_id_key[2].length = (pinfo->dst.len)>>2;
- transaction_id_key[2].key = (void*)pinfo->dst.data;
+ transaction_id_key[2].key = g_malloc(transaction_id_key[2].length);
+ memcpy(transaction_id_key[2].key, pinfo->dst.data, transaction_id_key[2].length);
}
transaction_id_key[3].length=0;
transaction_id_key[3].key=NULL;
@@ -238,6 +240,7 @@ dissect_reload_framing_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
else {
reload_frame=se_tree_lookup32_array(reload_framing_info->transaction_pdus, transaction_id_key);
}
+ g_free(transaction_id_key[2].key);
if (!reload_frame) {
/* create a "fake" pana_trans structure */