aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-agentx.c
diff options
context:
space:
mode:
authorChris Maynard <Christopher.Maynard@GTECH.COM>2011-03-16 14:51:53 +0000
committerChris Maynard <Christopher.Maynard@GTECH.COM>2011-03-16 14:51:53 +0000
commitd40ddf49c6f27cb2d92a4507354d23a61762bf6c (patch)
treee36924683cc92536a46e9dc031ce05cfdd4867ee /epan/dissectors/packet-agentx.c
parent9486d7dcc2b4a7c902736a580deb0aafc15f3070 (diff)
From Fulko Hew via bug 5755: Fix dissect_octet_string() so it properly displays
strings of any length. svn path=/trunk/; revision=36199
Diffstat (limited to 'epan/dissectors/packet-agentx.c')
-rw-r--r--epan/dissectors/packet-agentx.c10
1 files changed, 3 insertions, 7 deletions
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;
}