aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2012-06-14 20:13:45 +0000
committerJakub Zawadzki <darkjames-ws@darkjames.pl>2012-06-14 20:13:45 +0000
commit2919ac5a5e22d460d661418e91beb06a0aad4b0a (patch)
tree469cdc5a97efaf5f89d0fef846bc301cb7b4f958 /epan
parent089a048d4dd3b1515368a8c42acc5e74179315e2 (diff)
Add some explation about buffer size.
svn path=/trunk/; revision=43266
Diffstat (limited to 'epan')
-rw-r--r--epan/tvbuff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index 29e9e81428..7b36ca066f 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -2473,6 +2473,7 @@ tvb_get_ephemeral_string(tvbuff_t *tvb, const gint offset, const gint length)
gchar *
tvb_get_ephemeral_unicode_string(tvbuff_t *tvb, const gint offset, gint length, const guint encoding)
{
+ /* Longest UTF-8 character takes 6 bytes + 1 byte for NUL, round it to 8B */
gchar tmpbuf[8];
gunichar2 uchar;
gint i; /* Byte counter for tvbuff */
@@ -2696,6 +2697,7 @@ tvb_get_ephemeral_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp)
gchar *
tvb_get_ephemeral_unicode_stringz(tvbuff_t *tvb, const gint offset, gint *lengthp, const guint encoding)
{
+ /* Longest UTF-8 character takes 6 bytes + 1 byte for NUL, round it to 8B */
gchar tmpbuf[8];
gunichar2 uchar;
gint size; /* Number of UTF-16 characters */