diff --git a/epan/tvbuff_lz77.c b/epan/tvbuff_lz77.c index 6a1d0e3a6e..2cbfe5a7b0 100644 --- a/epan/tvbuff_lz77.c +++ b/epan/tvbuff_lz77.c @@ -28,7 +28,7 @@ static gboolean do_uncompress(tvbuff_t *tvb, int offset, int in_size, if (!tvb) return FALSE; - if (in_size > MAX_INPUT_SIZE) + if (!in_size || in_size > MAX_INPUT_SIZE) return FALSE; while (1) { diff --git a/epan/tvbuff_lz77huff.c b/epan/tvbuff_lz77huff.c index 86879bbb17..377fbcfb96 100644 --- a/epan/tvbuff_lz77huff.c +++ b/epan/tvbuff_lz77huff.c @@ -289,7 +289,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); diff --git a/epan/tvbuff_lznt1.c b/epan/tvbuff_lznt1.c index 7b1a5b64ac..9afb8d7487 100644 --- a/epan/tvbuff_lznt1.c +++ b/epan/tvbuff_lznt1.c @@ -82,7 +82,7 @@ do_uncompress(tvbuff_t *tvb, int offset, int in_size, wmem_array_t *obuf) if (!tvb) return FALSE; - if (in_size > MAX_INPUT_SIZE) + if (!in_size || in_size > MAX_INPUT_SIZE) return FALSE; while (in_off < in_size) {