Tiny bit better sanity check in block_util.c

This commit is contained in:
Lasse Collin 2009-01-26 13:06:49 +02:00
parent 2c5fe958e4
commit 1859d22d75
1 changed files with 1 additions and 1 deletions

View File

@ -58,7 +58,7 @@ lzma_block_unpadded_size(const lzma_block *block)
// NOTE: This function is used for validation too, so it is // NOTE: This function is used for validation too, so it is
// essential that these checks are always done even if // essential that these checks are always done even if
// Compressed Size is unknown. // Compressed Size is unknown.
if (block->version != 0 if (block == NULL || block->version != 0
|| block->header_size < LZMA_BLOCK_HEADER_SIZE_MIN || block->header_size < LZMA_BLOCK_HEADER_SIZE_MIN
|| block->header_size > LZMA_BLOCK_HEADER_SIZE_MAX || block->header_size > LZMA_BLOCK_HEADER_SIZE_MAX
|| (block->header_size & 3) || (block->header_size & 3)