]> git.ipfire.org Git - thirdparty/xz.git/commit
lzmainfo: Avoid integer overflow
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 16 Sep 2024 21:19:46 +0000 (23:19 +0200)
committerLasse Collin <lasse.collin@tukaani.org>
Wed, 18 Sep 2024 17:53:11 +0000 (20:53 +0300)
commitaef9a25b3200457c16846b046222fb2c7967afe0
tree6d02adf1186925e9dc2b2ff37069b6a87cbf3594
parent40a7f163f56aca6b3c8b83e9382f5e5cb4f8e93b
lzmainfo: Avoid integer overflow

The MB output can overflow with huge numbers. Most likely these are
invalid .lzma files anyway, but let's avoid garbage output.

lzmadec was adapted from LZMA Utils. The original code with this bug
was written in 2005, over 19 years ago.

Co-authored-by: Lasse Collin <lasse.collin@tukaani.org>
Closes: https://github.com/tukaani-project/xz/pull/144
(cherry picked from commit 76cfd0a9bb33ae8e534b1f73f6359dc825589f2f)
src/lzmainfo/lzmainfo.c