aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/index_hash.c
diff options
context:
space:
mode:
authorJia Tan <jiat0218@gmail.com>2022-08-17 20:20:16 +0800
committerLasse Collin <lasse.collin@tukaani.org>2023-01-09 16:34:32 +0200
commit2ac7bafc8f07c1edefe96a4a7a040ddfff0eb5bb (patch)
tree86eb20e05fefaa2ddddb96370d519eb415f36d3c /src/liblzma/common/index_hash.c
parentliblzma: Replaced hardcoded 0x0 index indicator byte with macro (diff)
downloadxz-2ac7bafc8f07c1edefe96a4a7a040ddfff0eb5bb.tar.xz
liblzma: Add NULL check to lzma_index_hash_append.
This is for consistency with lzma_index_append.
Diffstat (limited to 'src/liblzma/common/index_hash.c')
-rw-r--r--src/liblzma/common/index_hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liblzma/common/index_hash.c b/src/liblzma/common/index_hash.c
index c3c56674..f55f7bc8 100644
--- a/src/liblzma/common/index_hash.c
+++ b/src/liblzma/common/index_hash.c
@@ -145,7 +145,7 @@ lzma_index_hash_append(lzma_index_hash *index_hash, lzma_vli unpadded_size,
lzma_vli uncompressed_size)
{
// Validate the arguments.
- if (index_hash->sequence != SEQ_BLOCK
+ if (index_hash == NULL || index_hash->sequence != SEQ_BLOCK
|| unpadded_size < UNPADDED_SIZE_MIN
|| unpadded_size > UNPADDED_SIZE_MAX
|| uncompressed_size > LZMA_VLI_MAX)