From 618b8887dceb1c754d4698cfdb80448f320894cd Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 28 Apr 2005 18:07:40 +0000 Subject: [PATCH] Use tvb_ensure_bytes_exist() in tvb_get_string() instead of throwing an exception ourselves. Fixes bug 130. svn path=/trunk/; revision=14220 --- epan/tvbuff.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/epan/tvbuff.c b/epan/tvbuff.c index c184d9ba9e..aff4825cad 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -1713,8 +1713,7 @@ tvb_get_string(tvbuff_t *tvb, gint offset, gint length) const guint8 *ptr; guint8 *strbuf = NULL; - if (length < 0) - THROW(DissectorError); + tvb_ensure_bytes_exist(tvb, offset, length); ptr = ensure_contiguous(tvb, offset, length); strbuf = g_malloc(length + 1);