[libxml2/f18] workaround for crc/len check failure, rhbz#877567

Jaroslav Reznik jreznik at fedoraproject.org
Mon Nov 19 19:26:01 UTC 2012


commit f431c014272ef71c9e6504c4cb692e3726ef02e6
Author: Jaroslav Reznik <jreznik at redhat.com>
Date:   Mon Nov 19 20:23:40 2012 +0100

    workaround for crc/len check failure, rhbz#877567

 libxml2-2.9.0-do-not-check-crc.patch |   35 ++++++++++++++++++++++++++++++++++
 libxml2.spec                         |    8 ++++++-
 2 files changed, 42 insertions(+), 1 deletions(-)
---
diff --git a/libxml2-2.9.0-do-not-check-crc.patch b/libxml2-2.9.0-do-not-check-crc.patch
new file mode 100644
index 0000000..3e65077
--- /dev/null
+++ b/libxml2-2.9.0-do-not-check-crc.patch
@@ -0,0 +1,35 @@
+diff -up libxml2-2.9.0/xzlib.c.do-not-check-crc libxml2-2.9.0/xzlib.c
+--- libxml2-2.9.0/xzlib.c.do-not-check-crc	2012-09-11 05:52:46.000000000 +0200
++++ libxml2-2.9.0/xzlib.c	2012-11-19 19:28:42.431700534 +0100
+@@ -552,17 +552,20 @@ xz_decomp(xz_statep state)
+ #ifdef HAVE_ZLIB_H
+         if (state->how == GZIP) {
+             if (gz_next4(state, &crc) == -1 || gz_next4(state, &len) == -1) {
+-                xz_error(state, LZMA_DATA_ERROR, "unexpected end of file");
+-                return -1;
+-            }
+-            if (crc != state->zstrm.adler) {
+-                xz_error(state, LZMA_DATA_ERROR, "incorrect data check");
+-                return -1;
+-            }
+-            if (len != (state->zstrm.total_out & 0xffffffffL)) {
+-                xz_error(state, LZMA_DATA_ERROR, "incorrect length check");
+-                return -1;
+-            }
++                /*
++               xz_error(state, LZMA_DATA_ERROR, "unexpected end of file");
++               return -1;
++                */
++            } else {
++               if (crc != state->zstrm.adler) {
++                   xz_error(state, LZMA_DATA_ERROR, "incorrect data check");
++                   return -1;
++               }
++               if (len != (state->zstrm.total_out & 0xffffffffL)) {
++                   xz_error(state, LZMA_DATA_ERROR, "incorrect length check");
++                   return -1;
++               }
++           }
+             state->strm.avail_in = 0;
+             state->strm.next_in = NULL;
+             state->strm.avail_out = 0;
diff --git a/libxml2.spec b/libxml2.spec
index 41a0421..e4f7c68 100644
--- a/libxml2.spec
+++ b/libxml2.spec
@@ -1,7 +1,7 @@
 Summary: Library providing XML and HTML support
 Name: libxml2
 Version: 2.9.0
-Release: 2%{?dist}%{?extra_release}
+Release: 3%{?dist}%{?extra_release}
 License: MIT
 Group: Development/Libraries
 Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz
@@ -9,6 +9,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: python python-devel zlib-devel pkgconfig xz-devel
 URL: http://xmlsoft.org/
 Patch0: libxml2-multilib.patch
+Patch1: libxml2-2.9.0-do-not-check-crc.patch
 
 %description
 This library allows to manipulate XML files. It includes support
@@ -68,6 +69,8 @@ at parse time or later once the document has been modified.
 %prep
 %setup -q
 %patch0 -p1
+# workaround for #877567 - Very weird bug gzip decompression bug in "recent" libxml2 versions
+%patch1 -p1 -b .do-not-check-crc
 
 %build
 %configure
@@ -150,6 +153,9 @@ rm -fr %{buildroot}
 %doc doc/python.html
 
 %changelog
+* Mon Nov 19 2012 Jaroslav Reznik <jreznik at redhat.com> - 2.9.0-3
+- workaround for crc/len check failure, rhbz#877567
+
 * Thu Oct 11 2012 Daniel Veillard <veillard at redhat.com> - 2.9.0-2
 - remaining cleanups from merge bug rhbz#226079
 - do not put the docs in the main package, only in -devel rhbz#864731


More information about the scm-commits mailing list