aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-giop.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-08-12 16:32:28 +0000
committerGerald Combs <gerald@wireshark.org>2005-08-12 16:32:28 +0000
commitf7af2880e0c9a3697734750bb0b02fd9e1ddeb4b (patch)
tree8c0136b3df222cbfc5c75ffe1d926f6b2d06d306 /epan/dissectors/packet-giop.c
parent86d66bc85c94bd356c8027a869218f55092a157f (diff)
Don't try to allocate more than ITEM_LABEL_LENGTH bytes for something we're
adding to the tree. Fixes bugs 349 and 352. svn path=/trunk/; revision=15315
Diffstat (limited to 'epan/dissectors/packet-giop.c')
-rw-r--r--epan/dissectors/packet-giop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c
index 8ab4dd5353..5c0abe2850 100644
--- a/epan/dissectors/packet-giop.c
+++ b/epan/dissectors/packet-giop.c
@@ -2879,10 +2879,11 @@ dissect_reply_body (tvbuff_t *tvb, guint offset, packet_info *pinfo,
proto_tree_add_text(tree, tvb, offset-4, 4,
"Exception length: %u", sequence_length);
}
- if (sequence_length != 0)
+ if (sequence_length != 0 && sequence_length < ITEM_LABEL_LENGTH)
{
#if 1
+ tvb_ensure_bytes_exist(tvb, offset, sequence_length);
header->exception_id = g_new0(gchar,sequence_length ); /* allocate buffer */
/* read exception id from buffer and store in*/