TVB: Don't uncompress zero sized buffers

This commit is contained in:
Jaap Keuter 2022-01-19 05:19:45 +00:00 committed by A Wireshark GitLab Utility
parent 8202125fe3
commit e1f025d9f4
3 changed files with 3 additions and 3 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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) {