From f16e12d5e755d371247202fcccbcccd1ec16b2cf Mon Sep 17 00:00:00 2001 From: Jia Tan Date: Wed, 17 Aug 2022 20:20:16 +0800 Subject: [PATCH] liblzma: Add NULL check to lzma_index_hash_append. This is for consistency with lzma_index_append. --- src/liblzma/common/index_hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/liblzma/common/index_hash.c b/src/liblzma/common/index_hash.c index c3c5667..f55f7bc 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)