aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/index_encoder.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2009-04-28 23:08:32 +0300
committerLasse Collin <lasse.collin@tukaani.org>2009-04-28 23:08:32 +0300
commit21c6b94373d239d7e86bd480fcd558e30391712f (patch)
tree072a944fecdd87fcd25a80a723d8b1d220d2f642 /src/liblzma/common/index_encoder.c
parentFix uint32_t -> size_t in ARM and ARM-Thumb filters. (diff)
downloadxz-21c6b94373d239d7e86bd480fcd558e30391712f.tar.xz
Fixed a crash in liblzma.
liblzma tries to avoid useless free()/malloc() pairs in initialization when multiple files are handled using the same lzma_stream. This didn't work with filter chains due to comparison of wrong pointers in lzma_next_coder_init(), making liblzma think that no memory reallocation is needed even when it actually is. Easy way to trigger this bug is to decompress two files with a single xz command. The first file should have e.g. x86+LZMA2 as the filter chain, and the second file just LZMA2.
Diffstat (limited to 'src/liblzma/common/index_encoder.c')
-rw-r--r--src/liblzma/common/index_encoder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liblzma/common/index_encoder.c b/src/liblzma/common/index_encoder.c
index 662f646b..e23963ce 100644
--- a/src/liblzma/common/index_encoder.c
+++ b/src/liblzma/common/index_encoder.c
@@ -189,7 +189,7 @@ extern lzma_ret
lzma_index_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
lzma_index *i)
{
- lzma_next_coder_init(lzma_index_encoder_init, next, allocator);
+ lzma_next_coder_init(&lzma_index_encoder_init, next, allocator);
if (i == NULL)
return LZMA_PROG_ERROR;