1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00
xz-archive/src/liblzma/common
Lasse Collin 1c9a5786d2 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.
2022-02-20 20:36:27 +02:00
..
alone_decoder.c liblzma: Remove incorrect uses of lzma_attribute((__unused__)). 2019-06-24 22:50:36 +03:00
alone_decoder.h liblzma: Be less picky in lzma_alone_decoder(). 2013-03-23 22:25:15 +02:00
alone_encoder.c Rename unaligned_read32ne to read32ne, and similarly for the others. 2019-12-31 00:47:49 +02:00
auto_decoder.c liblzma: Fix lzma_memlimit_set(strm, 0). 2017-03-30 19:51:14 +03:00
block_buffer_decoder.c liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
block_buffer_encoder.c liblzma: Add support for lzma_block.ignore_check. 2014-08-05 22:03:30 +03:00
block_buffer_encoder.h liblzma: Add lzma_block_uncomp_encode(). 2013-03-23 19:17:33 +02:00
block_decoder.c liblzma: Make Block decoder catch certain types of errors better. 2022-02-20 20:36:27 +02:00
block_decoder.h liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
block_encoder.c liblzma: Avoid multiple definitions of lzma_coder structures. 2016-11-21 20:24:50 +02:00
block_encoder.h liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
block_header_decoder.c Rename unaligned_read32ne to read32ne, and similarly for the others. 2019-12-31 00:47:49 +02:00
block_header_encoder.c Rename unaligned_read32ne to read32ne, and similarly for the others. 2019-12-31 00:47:49 +02:00
block_util.c liblzma: Fix comments. 2019-06-03 20:41:54 +03:00
common.c Add LZMA_RET_INTERNAL1..8 to lzma_ret and use one for LZMA_TIMED_OUT. 2019-06-24 23:25:41 +03:00
common.h liblzma: Add rough support for output-size-limited encoding in LZMA1. 2021-01-14 18:58:13 +02:00
easy_buffer_encoder.c liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
easy_decoder_memusage.c Put the interesting parts of XZ Utils into the public domain. 2009-04-13 11:27:40 +03:00
easy_encoder.c liblzma: Make lzma_stream_encoder_init() static (second try). 2011-04-11 09:27:57 +03:00
easy_encoder_memusage.c Put the interesting parts of XZ Utils into the public domain. 2009-04-13 11:27:40 +03:00
easy_preset.c Put the interesting parts of XZ Utils into the public domain. 2009-04-13 11:27:40 +03:00
easy_preset.h Put the interesting parts of XZ Utils into the public domain. 2009-04-13 11:27:40 +03:00
file_info.c spelling 2019-05-11 20:52:37 +03:00
filter_buffer_decoder.c liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
filter_buffer_encoder.c liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
filter_common.c liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
filter_common.h liblzma: Fix comments. 2019-06-03 20:41:54 +03:00
filter_decoder.c liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
filter_decoder.h liblzma: Fix comments. 2019-06-03 20:41:54 +03:00
filter_encoder.c liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
filter_encoder.h liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
filter_flags_decoder.c liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
filter_flags_encoder.c liblzma: Fix comments. 2019-06-03 20:41:54 +03:00
hardware_cputhreads.c liblzma: Add lzma_cputhreads(). 2014-06-18 22:04:24 +03:00
hardware_physmem.c spelling 2019-05-11 20:52:37 +03:00
index.c Typo fixes from fossies.org. 2020-03-23 18:07:50 +02:00
index.h Revised the Index handling code. 2009-12-31 22:45:53 +02:00
index_decoder.c liblzma: Don't verify header CRC32s if building for fuzz testing. 2018-10-26 22:49:10 +03:00
index_decoder.h liblzma: Make lzma_index_decoder_init() visible to other liblzma funcs. 2017-03-30 20:03:05 +03:00
index_encoder.c liblzma: Avoid multiple definitions of lzma_coder structures. 2016-11-21 20:24:50 +02:00
index_encoder.h liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
index_hash.c liblzma: Don't verify header CRC32s if building for fuzz testing. 2018-10-26 22:49:10 +03:00
Makefile.inc liblzma: Rename EROFS LZMA to MicroLZMA. 2021-09-05 20:38:12 +03:00
memcmplen.h Rename unaligned_read32ne to read32ne, and similarly for the others. 2019-12-31 00:47:49 +02:00
microlzma_decoder.c liblzma: Rename EROFS LZMA to MicroLZMA. 2021-09-05 20:38:12 +03:00
microlzma_encoder.c liblzma: Rename EROFS LZMA to MicroLZMA. 2021-09-05 20:38:12 +03:00
outqueue.c liblzma: Make lzma_outq usable for threaded decompression too. 2021-01-09 22:18:23 +02:00
outqueue.h liblzma: Make lzma_outq usable for threaded decompression too. 2021-01-09 22:18:23 +02:00
stream_buffer_decoder.c liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
stream_buffer_encoder.c liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
stream_decoder.c liblzma: Similar memlimit fix for stream_, alone_, and auto_decoder. 2017-03-30 19:16:55 +03:00
stream_decoder.h liblzma: Make the use of lzma_allocator const-correct. 2012-07-17 18:19:59 +03:00
stream_encoder.c liblzma: Avoid multiple definitions of lzma_coder structures. 2016-11-21 20:24:50 +02:00
stream_encoder_mt.c liblzma: Fix a wrong comment in stream_encoder_mt.c. 2021-01-24 19:22:35 +02:00
stream_flags_common.c Put the interesting parts of XZ Utils into the public domain. 2009-04-13 11:27:40 +03:00
stream_flags_common.h Put the interesting parts of XZ Utils into the public domain. 2009-04-13 11:27:40 +03:00
stream_flags_decoder.c Rename unaligned_read32ne to read32ne, and similarly for the others. 2019-12-31 00:47:49 +02:00
stream_flags_encoder.c Rename unaligned_read32ne to read32ne, and similarly for the others. 2019-12-31 00:47:49 +02:00
vli_decoder.c spelling 2019-05-11 20:52:37 +03:00
vli_encoder.c Fix incorrect use of "restrict". 2009-09-15 21:07:23 +03:00
vli_size.c Put the interesting parts of XZ Utils into the public domain. 2009-04-13 11:27:40 +03:00