]> git.ipfire.org Git - thirdparty/xz.git/commit
liblzma: Fix infinite loop in LZMA encoder init with dict_size >= 2 GiB.
authorLasse Collin <lasse.collin@tukaani.org>
Tue, 22 Nov 2022 09:20:17 +0000 (11:20 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Thu, 24 Nov 2022 08:57:03 +0000 (10:57 +0200)
commit5fecba6022cbbeed8103b49d79b2fb36086be72d
tree4e55479acb312b1d202846c61cc619ece21b5b36
parent1946b2b141d8b12c9325ba48d3a04ad8e8206750
liblzma: Fix infinite loop in LZMA encoder init with dict_size >= 2 GiB.

The encoder doesn't support dictionary sizes larger than 1536 MiB.
This is validated, for example, when calculating the memory usage
via lzma_raw_encoder_memusage(). It is also enforced by the LZ
part of the encoder initialization. However, LZMA encoder with
LZMA_MODE_NORMAL did an unsafe calculation with dict_size before
such validation and that results in an infinite loop if dict_size
was 2 << 30 or greater.
src/liblzma/lzma/lzma_encoder.c