From bcd55c173bfdccee7248e34218115935b2cdddba Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Fri, 20 May 2011 03:22:27 +0000 Subject: [PATCH] Copy data from the TVB into ep_alloc'd memory, rather than saving a pointer into the TVB. svn path=/trunk/; revision=37323 --- epan/dissectors/packet-rmt-lct.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/epan/dissectors/packet-rmt-lct.c b/epan/dissectors/packet-rmt-lct.c index 931e53f944..ea27477d69 100644 --- a/epan/dissectors/packet-rmt-lct.c +++ b/epan/dissectors/packet-rmt-lct.c @@ -261,6 +261,7 @@ gboolean lct_dissector(struct _lct_ptr l, struct _fec_ptr f, tvbuff_t *tvb, prot guint16 buffer16; gboolean is_flute_tmp =FALSE; gboolean is_flute =FALSE; + guint8 *tmp; /* Set up structures needed to add the protocol subtree and manage it */ proto_item *ti; @@ -410,7 +411,9 @@ gboolean lct_dissector(struct _lct_ptr l, struct _fec_ptr f, tvbuff_t *tvb, prot break; } - l.lct->toi_extended = tvb_get_ptr(tvb, *offset, l.lct->toi_size); + tmp = ep_alloc(l.lct->toi_size); + tvb_memcpy(tvb, tmp, *offset, l.lct->toi_size); + l.lct->toi_extended = tmp; if (tree) { @@ -419,7 +422,7 @@ gboolean lct_dissector(struct _lct_ptr l, struct _fec_ptr f, tvbuff_t *tvb, prot else proto_tree_add_uint64(lct_tree, l.hf->toi, tvb, *offset, l.lct->toi_size, l.lct->toi); - proto_tree_add_bytes(lct_tree, l.hf->toi_extended, tvb, *offset, l.lct->toi_size, l.lct->toi_extended); + proto_tree_add_item(lct_tree, l.hf->toi_extended, tvb, *offset, l.lct->toi_size, ENC_NA); } *offset += l.lct->toi_size;