[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-4.1-testing] XZ decompressor: Fix decoding of empty LZMA2 streams


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
  • Date: Thu, 20 Dec 2012 11:33:09 +0000
  • Delivery-date: Thu, 20 Dec 2012 11:33:18 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Lasse Collin <lasse.collin@xxxxxxxxxxx>
# Date 1355916493 -3600
# Node ID ee0ad4dab0a5323898b478000fc7358cce631db5
# Parent  d72d30447ae8a1f66b6869f30e1e32ff57c8c4f6
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>
xen-unstable changeset: 23869:db1ea4b127cd
xen-unstable date: Thu Sep 22 17:33:48 UTC 2011
---


diff -r d72d30447ae8 -r ee0ad4dab0a5 xen/common/xz/dec_lzma2.c
--- a/xen/common/xz/dec_lzma2.c Wed Dec 19 12:25:27 2012 +0100
+++ b/xen/common/xz/dec_lzma2.c Wed Dec 19 12:28:13 2012 +0100
@@ -969,6 +969,9 @@ XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_
                         */
                        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 @@ XZ_EXTERN enum xz_ret INIT xz_dec_lzma2_
                                                lzma_reset(s);
                                }
                        } else {
-                               if (tmp == 0x00)
-                                       return XZ_STREAM_END;
-
                                if (tmp > 0x02)
                                        return XZ_DATA_ERROR;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.