diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2008-03-10 13:44:29 +0200 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2008-03-10 13:44:29 +0200 |
commit | 596fa1fac72823e4ef5bc26bb53f9090445bf748 (patch) | |
tree | 465dd6ebc85e6fbb82481fe9afaf4d5ac37c9352 /src | |
parent | Don't fill allocated memory with 0xFD when debugging is (diff) | |
download | xz-596fa1fac72823e4ef5bc26bb53f9090445bf748.tar.xz |
Always initialize lz->temp_size in lz_decoder.c. temp_size did
get initialized as a side-effect after allocating a new decoder,
but not when the decoder was reused.
Diffstat (limited to 'src')
-rw-r--r-- | src/liblzma/lz/lz_decoder.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/liblzma/lz/lz_decoder.c b/src/liblzma/lz/lz_decoder.c index 92aaff6a..63945a18 100644 --- a/src/liblzma/lz/lz_decoder.c +++ b/src/liblzma/lz/lz_decoder.c @@ -429,11 +429,6 @@ lzma_lz_decoder_reset(lzma_lz_decoder *lz, lzma_allocator *allocator, return LZMA_MEM_ERROR; } - // Clean up the temporary buffer to make it very sure that there are - // no information leaks when multiple steams are decoded with the - // same decoder structures. - memzero(lz->temp, LZMA_BUFFER_SIZE); - // Reset the variables so that lz_get_byte(lz, 0) will return '\0'. lz->pos = 0; lz->start = 0; @@ -442,6 +437,12 @@ lzma_lz_decoder_reset(lzma_lz_decoder *lz, lzma_allocator *allocator, lz->eopm_detected = false; lz->next_finished = false; lz->this_finished = false; + lz->temp_size = 0; + + // Clean up the temporary buffer to make it very sure that there are + // no information leaks when multiple steams are decoded with the + // same decoder structures. + memzero(lz->temp, LZMA_BUFFER_SIZE); // Set the process function pointer. lz->process = process; |