summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-04-28 18:07:40 +0000
committerGerald Combs <gerald@wireshark.org>2005-04-28 18:07:40 +0000
commit618b8887dceb1c754d4698cfdb80448f320894cd (patch)
treef35cd16698906dcb2a170e6d1041f463c654a673
parent537fa72b2250b7cc44a2b036c88e72577b159568 (diff)
downloadwireshark-618b8887dceb1c754d4698cfdb80448f320894cd.tar.gz
Use tvb_ensure_bytes_exist() in tvb_get_string() instead of throwing an
exception ourselves. Fixes bug 130. svn path=/trunk/; revision=14220
-rw-r--r--epan/tvbuff.c3
1 files changed, 1 insertions, 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);