aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
authorgerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2005-07-21 21:40:57 +0000
committergerald <gerald@f5534014-38df-0310-8fa8-9805f1628bb7>2005-07-21 21:40:57 +0000
commit1d0d1bd3e07f941512f8e629390b2a6ab86c491b (patch)
tree064aef60ca5dd0e00510e66d7527488c8e74804b /epan/tvbuff.c
parent8cb2bd149d04d2386a0c522e97ef4669564f5585 (diff)
When trying to handle gzip-compressed data, don't seek past the end of our
compressed data buffer. Fixes bug 288. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14981 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r--epan/tvbuff.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index aff4825cad..e3878bf76e 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -2408,6 +2408,12 @@ tvb_uncompress(tvbuff_t *tvb, int offset, int comprlen)
inflateReset(strm);
next = c;
strm->next_in = next;
+ if (c - compr > comprlen) {
+ g_free(strm);
+ g_free(compr);
+ g_free(strmbuf);
+ return NULL;
+ }
comprlen -= (c - compr);
err = inflateInit2(strm, wbits);