diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2019-10-20 22:13:54 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2019-10-21 07:11:40 +0000 |
commit | bc44c7e0cdd48d836d5499734d8e5392f9a31d35 (patch) | |
tree | eaf712d568c9460c0d1509f6a21a3df540b5d1bc /epan/tvbuff_lz77huff.c | |
parent | 15a18f385f6d7eb908b9c33173a6d1b87e50b967 (diff) |
TVB(LZ77+Huffman): return proper value on error (CID1451652)
When preparing to decompress the encoded tree size is the minimum input
size. When not met the return value (FALSE) would still indicate success,
being value 0. This could lead to NULL pointer dereference later on.
Change the return value to -1 to match the function return type.
Change-Id: Ie81d98f55af33518a34bc0b79c29450064886bc3
Reviewed-on: https://code.wireshark.org/review/34818
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/tvbuff_lz77huff.c')
-rw-r--r-- | epan/tvbuff_lz77huff.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/tvbuff_lz77huff.c b/epan/tvbuff_lz77huff.c index 3448bfad29..a0e9af5dea 100644 --- a/epan/tvbuff_lz77huff.c +++ b/epan/tvbuff_lz77huff.c @@ -170,7 +170,7 @@ static int PrefixCodeTreeRebuild( struct hf_tree *tree, } if (input->size < ENCODED_TREE_SIZE) - return FALSE; + return -1; for (i = 0; i < ENCODED_TREE_SIZE; i++) { symbolInfo[2*i].symbol = 2*i; |