aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2013-02-27 16:38:06 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2013-02-27 16:38:06 +0100
commita1ae2b75a71b4b99948aa0f9a15cf1de52bb40d6 (patch)
treedeba2860881324f537b40a5924128757466079a9 /archival
parentefb800439fd29382404fe8044774903b3b52db3f (diff)
downloadbusybox-w32-a1ae2b75a71b4b99948aa0f9a15cf1de52bb40d6.tar.gz
busybox-w32-a1ae2b75a71b4b99948aa0f9a15cf1de52bb40d6.tar.bz2
busybox-w32-a1ae2b75a71b4b99948aa0f9a15cf1de52bb40d6.zip
xz: fix decoding of LZMA2 streams having no uncompressed data.
No .xz encoder creates files with empty LZMA2 streams, but such files would still be valid and decompressors must accept them. Note that empty .xz files are a different thing than empty LZMA2 streams. This bug didn't affect typical .xz files that had no uncompressed data. Signed-off-by: Lasse Collin <lasse.collin@tukaani.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival')
-rw-r--r--archival/libarchive/unxz/xz_dec_lzma2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/archival/libarchive/unxz/xz_dec_lzma2.c b/archival/libarchive/unxz/xz_dec_lzma2.c
index b6d10af9d..3c2dc88b7 100644
--- a/archival/libarchive/unxz/xz_dec_lzma2.c
+++ b/archival/libarchive/unxz/xz_dec_lzma2.c
@@ -971,6 +971,9 @@ XZ_EXTERN NOINLINE enum xz_ret XZ_FUNC xz_dec_lzma2_run(
971 */ 971 */
972 tmp = b->in[b->in_pos++]; 972 tmp = b->in[b->in_pos++];
973 973
974 if (tmp == 0x00)
975 return XZ_STREAM_END;
976
974 if (tmp >= 0xE0 || tmp == 0x01) { 977 if (tmp >= 0xE0 || tmp == 0x01) {
975 s->lzma2.need_props = true; 978 s->lzma2.need_props = true;
976 s->lzma2.need_dict_reset = false; 979 s->lzma2.need_dict_reset = false;
@@ -1003,9 +1006,6 @@ XZ_EXTERN NOINLINE enum xz_ret XZ_FUNC xz_dec_lzma2_run(
1003 lzma_reset(s); 1006 lzma_reset(s);
1004 } 1007 }
1005 } else { 1008 } else {
1006 if (tmp == 0x00)
1007 return XZ_STREAM_END;
1008
1009 if (tmp > 0x02) 1009 if (tmp > 0x02)
1010 return XZ_DATA_ERROR; 1010 return XZ_DATA_ERROR;
1011 1011