This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-changelog] [xen-unstable] XZ decompressor: Fix decoding of empty LZ

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] XZ decompressor: Fix decoding of empty LZMA2 streams
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Wed, 28 Sep 2011 02:55:19 +0100
Delivery-date: Tue, 27 Sep 2011 18:56:46 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1316712828 -3600
# Node ID db1ea4b127cd99bcf6fa731ac3865c1988b56ae7
# Parent  28147fd781af7cf8717d18165fecf1442ea77db3
XZ decompressor: Fix decoding of empty LZMA2 streams

From: Lasse Collin <lasse.collin@xxxxxxxxxxx>

The old code considered valid empty LZMA2 streams to be corrupt.
Note that a typical empty .xz file has no LZMA2 data at all,
and thus most .xz files having no uncompressed data are handled
correctly even without this fix.

Signed-off-by: Lasse Collin <lasse.collin@xxxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

diff -r 28147fd781af -r db1ea4b127cd xen/common/xz/dec_lzma2.c
--- a/xen/common/xz/dec_lzma2.c Thu Sep 22 18:32:34 2011 +0100
+++ b/xen/common/xz/dec_lzma2.c Thu Sep 22 18:33:48 2011 +0100
@@ -969,6 +969,9 @@
                        tmp = b->in[b->in_pos++];
+                       if (tmp == 0x00)
+                               return XZ_STREAM_END;
                        if (tmp >= 0xE0 || tmp == 0x01) {
                                s->lzma2.need_props = true;
                                s->lzma2.need_dict_reset = false;
@@ -1001,9 +1004,6 @@
                        } else {
-                               if (tmp == 0x00)
-                                       return XZ_STREAM_END;
                                if (tmp > 0x02)
                                        return XZ_DATA_ERROR;

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] XZ decompressor: Fix decoding of empty LZMA2 streams, Xen patchbot-unstable <=