aboutsummaryrefslogtreecommitdiff
path: root/src/xz/signals.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-02-20 20:36:27 +0200
committerLasse Collin <lasse.collin@tukaani.org>2022-02-20 20:36:27 +0200
commit1c9a5786d206b4abc8e427326651c8174baea753 (patch)
treee504643962b3bd30ffe73fc8d9f67922de193e70 /src/xz/signals.c
parentTests: Add bad-1-lzma2-11.xz. (diff)
downloadxz-1c9a5786d206b4abc8e427326651c8174baea753.tar.xz
liblzma: Make Block decoder catch certain types of errors better.
Now it limits the input and output buffer sizes that are passed to a raw decoder. This way there's no need to check if the sizes can grow too big or overflow when updating Compressed Size and Uncompressed Size counts. This also means that a corrupt file cannot cause the raw decoder to process useless extra input or output that would exceed the size info in Block Header (and thus cause LZMA_DATA_ERROR anyway). More importantly, now the size information is verified more carefully in case raw decoder returns LZMA_OK. This doesn't really matter with the current single-threaded .xz decoder as the errors would be detected slightly later anyway. But this helps avoiding corner cases in the upcoming threaded decompressor, and it might help other Block decoder uses outside liblzma too. The test files bad-1-lzma2-{9,10,11}.xz test these conditions. With the single-threaded .xz decoder the only difference is that LZMA_DATA_ERROR is detected in a difference place now.
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions