From d40ddf49c6f27cb2d92a4507354d23a61762bf6c Mon Sep 17 00:00:00 2001 From: Chris Maynard Date: Wed, 16 Mar 2011 14:51:53 +0000 Subject: From Fulko Hew via bug 5755: Fix dissect_octet_string() so it properly displays strings of any length. svn path=/trunk/; revision=36199 --- epan/dissectors/packet-agentx.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'epan/dissectors/packet-agentx.c') diff --git a/epan/dissectors/packet-agentx.c b/epan/dissectors/packet-agentx.c index b1a733fcc1..47fcc300f2 100644 --- a/epan/dissectors/packet-agentx.c +++ b/epan/dissectors/packet-agentx.c @@ -300,19 +300,15 @@ static int dissect_octet_string(tvbuff_t *tvb, proto_tree *tree, int offset, char flags) { guint32 n_oct, p_noct; - char context[1024]; + guint8 *str_buf; NORLEL(flags, n_oct, tvb, offset); p_noct = PADDING(n_oct); - if (n_oct >= 1024) - THROW(ReportedBoundsError); - if (n_oct > 0) - tvb_get_nstringz(tvb, offset + 4, n_oct, context); - context[n_oct]='\0'; + str_buf = tvb_get_ephemeral_string(tvb, offset + 4, n_oct); proto_tree_add_uint(tree, hf_ostring_len, tvb, offset, 4, n_oct); - proto_tree_add_string(tree, hf_ostring, tvb, offset + 4, n_oct, context); + proto_tree_add_string(tree, hf_ostring, tvb, offset + 4, n_oct, str_buf); return p_noct + 4; } -- cgit v1.2.3