TVB: Don't uncompress zero sized buffers
This commit is contained in:
parent
8202125fe3
commit
e1f025d9f4
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue