aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/tvbuff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index 5246159055..96bae3108d 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -2363,6 +2363,8 @@ tvb_get_unicode_string(tvbuff_t *tvb, const gint offset, gint length, const guin
gint i; /* Byte counter for tvbuff */
GString *strbuf = NULL;
+ tvb_ensure_bytes_exist(tvb, offset, length);
+
strbuf = g_string_new(NULL);
for(i = 0; i < length; i += 2) {
@@ -2499,6 +2501,8 @@ tvb_get_ephemeral_unicode_string(tvbuff_t *tvb, const gint offset, gint length,
gint tmpbuf_len;
emem_strbuf_t *strbuf = NULL;
+ tvb_ensure_bytes_exist(tvb, offset, length);
+
strbuf = ep_strbuf_new(NULL);
for(i = 0; i < length; i += 2) {