busybox/archival/libarchive
Lasse Collin c3045edec2 xz: fix incorrect XZ_BUF_ERROR
xz_dec_run() could incorrectly return XZ_BUF_ERROR if
all of the following was true:

  - The caller knows how many bytes of output to expect
    and only provides that much output space.

  - When the last output bytes are decoded, the
    caller-provided input buffer ends right before
    the LZMA2 end of payload marker. So LZMA2 won't
    provide more output anymore, but it won't know it
    yet and thus won't return XZ_STREAM_END yet.

  - A BCJ filter is in use and it hasn't left any
    unfiltered bytes in the temp buffer. This can happen
    with any BCJ filter, but in practice it's more likely
    with filters other than the x86 BCJ.

This fixes <https://bugzilla.redhat.com/show_bug.cgi?id=735408>
where Squashfs thinks that a valid file system is corrupt.
Thanks to Jindrich Novy for telling me that such a bug report
exists, Phillip Lougher for providing excellent debug info,
and other people on #fedora-ppc.

This also fixes a similar bug in single-call mode where the
uncompressed size of a XZ Block using BCJ + LZMA2 was 0 bytes
and caller provided no output space. Many empty .xz files
don't contain any Blocks and thus don't trigger this bug.

This also tweaks a closely related detail: xz_dec_bcj_run()
could call xz_dec_lzma2_run() to decode into temp buffer when
it was known to be useless. This was harmless although it
wasted a minuscule number of CPU cycles.

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-27 16:39:56 +01:00
..
bz regularize options which control size/speed trade 2011-09-10 13:25:57 +02:00
unxz xz: fix incorrect XZ_BUF_ERROR 2013-02-27 16:39:56 +01:00
data_align.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
data_extract_all.c rpm: use "create+rename" method of replacing existing files 2013-02-20 15:58:42 +01:00
data_extract_to_command.c tar: add support for PAX-encoded path=LONGFILENAME 2012-02-23 13:45:18 +01:00
data_extract_to_stdout.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
data_skip.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
decompress_bunzip2.c update seamless uncompression code 2012-03-06 16:27:48 +01:00
decompress_gunzip.c whitespace cleanup. no code changes 2013-01-14 15:57:44 +01:00
decompress_uncompress.c whitespace cleanup. no code changes 2013-01-14 15:57:44 +01:00
decompress_unlzma.c update seamless uncompression code 2012-03-06 16:27:48 +01:00
decompress_unxz.c update seamless uncompression code 2012-03-06 16:27:48 +01:00
filter_accept_all.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
filter_accept_list_reassign.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
filter_accept_list.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
filter_accept_reject_list.c trivial small speed optimization 2012-06-22 15:54:05 +02:00
find_list_entry.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
get_header_ar.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
get_header_cpio.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
get_header_tar_bz2.c update seamless uncompression code 2012-03-06 16:27:48 +01:00
get_header_tar_gz.c update seamless uncompression code 2012-03-06 16:27:48 +01:00
get_header_tar_lzma.c update seamless uncompression code 2012-03-06 16:27:48 +01:00
get_header_tar.c dpkg: fix creation of .list files (were empty since b768aeb). Closes 5324 2012-06-22 16:27:21 +02:00
header_list.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
header_skip.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
header_verbose_list.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
init_handle.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
Kbuild.src build system: fix build failure when only gunzip is selected 2012-05-20 12:56:17 +02:00
liblzo.h
lzo1x_1.c
lzo1x_1o.c
lzo1x_9x.c whitespace cleanup. no code changes 2013-01-14 15:57:44 +01:00
lzo1x_c.c whitespace cleanup. no code changes 2013-01-14 15:57:44 +01:00
lzo1x_d.c whitespace cleanup. no code changes 2013-01-14 15:57:44 +01:00
open_transformer.c tar,rpm2cpio: check that child decompressor did not error out 2012-03-06 16:33:42 +01:00
seek_by_jump.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
seek_by_read.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
unpack_ar_archive.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00