aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lz/lz_decoder.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-12-15 10:01:59 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-12-15 10:01:59 +0200
commitff7fb2c605bccc411069e07b9f11fb957aea2ddf (patch)
treec9055532dd69fb9a77147849bb28e55d3e63de6e /src/liblzma/lz/lz_decoder.h
parentName the package "xz" in configure.ac. (diff)
downloadxz-ff7fb2c605bccc411069e07b9f11fb957aea2ddf.tar.xz
Fix data corruption in LZMA2 decoder.
Diffstat (limited to '')
-rw-r--r--src/liblzma/lz/lz_decoder.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/liblzma/lz/lz_decoder.h b/src/liblzma/lz/lz_decoder.h
index 53ee1c1e..5ac44057 100644
--- a/src/liblzma/lz/lz_decoder.h
+++ b/src/liblzma/lz/lz_decoder.h
@@ -45,6 +45,9 @@ typedef struct {
/// Size of the dictionary
size_t size;
+ /// True when dictionary should be reset before decoding more data.
+ bool need_reset;
+
} lzma_dict;
@@ -224,9 +227,8 @@ dict_write(lzma_dict *restrict dict, const uint8_t *restrict in,
static inline void
dict_reset(lzma_dict *dict)
{
- dict->pos = 0;
- dict->full = 0;
- dict->buf[dict->size - 1] = '\0';
+ dict->need_reset = true;
+ return;
}
#endif