diff options
Diffstat (limited to 'epan/tvbuff_lz77huff.c')
-rw-r--r-- | epan/tvbuff_lz77huff.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/epan/tvbuff_lz77huff.c b/epan/tvbuff_lz77huff.c index 86879bbb17..7c8de27ef5 100644 --- a/epan/tvbuff_lz77huff.c +++ b/epan/tvbuff_lz77huff.c @@ -194,6 +194,10 @@ static int PrefixCodeTreeRebuild( struct hf_tree *tree, j = 1; for (; i < 512; i++) { + //ws_assert(j < TREE_SIZE); + if (j >= TREE_SIZE) { + return -1; + } tree->nodes[j].symbol = symbolInfo[i].symbol; tree->nodes[j].leaf = TRUE; mask <<= symbolInfo[i].length - bits; @@ -289,7 +293,7 @@ static gboolean do_uncompress(struct input *input, if (!input->tvb) return FALSE; - if (input->size > MAX_INPUT_SIZE) + if (!input->size || input->size > MAX_INPUT_SIZE) return FALSE; rc = PrefixCodeTreeRebuild(&tree, input); |