]> git.ipfire.org Git - thirdparty/libarchive.git/commit
7zip: Cap maximum allocation for SFX handling
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 27 Apr 2026 17:58:05 +0000 (19:58 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 27 Apr 2026 18:10:06 +0000 (20:10 +0200)
commit9082a50780f21855b238be3e3670110692042382
tree2ca0277cf291070c9c36fae6cc7c3e9ba45fd2f3
parent618a9d77d38b18df566f057ae9c5ae2e5a8d14bc
7zip: Cap maximum allocation for SFX handling

If 7zip header cannot be found within roughly first 8 MB of data, skip
detection and assume that file is not a valid 7zip archive.

This avoids various 32 bit truncation issues as well as out of memory
conditions.

Reported by various individuals:
- Amemoyoi
- b4sh5i
- Jie Zhu
- Tikket
- wooseokdotkim

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
libarchive/archive_read_support_format_7zip.c