On 2012-12-19 Vincent Lefevre <vinc...@vinc17.net> wrote:
[...]
> Control: retitle -2 libxml2: gzip decompression truncates the output 
> (possible data loss)
> Control: found -2 2.8.0+dfsg1-7
> Control: tag -2 upstream fixed-upstream

> On 2012-12-19 00:16:41 +0100, Vincent Lefevre wrote:
> [...]
>> $ gnucash test.gnucash
>> Found Finance::Quote version 1.17
>> I/O error : Resource temporarily unavailable
>> $

> I've done tests with gdb, and the problem occurs at

>     xmlParseDocument( ctxt->data.saxParserCtxt );

> in src/backend/xml/sixtp.c line 709 (sixtp_parse_file_common).
> It comes from a known bug in libxml2, discussed here:

>   https://bugzilla.redhat.com/show_bug.cgi?id=877567

> It is fixed upstream.
[...]

Hello,

I am not familiar with libxml2 development, however
<http://www.xmlsoft.org/downloads.html> points to
git://git.gnome.org/libxml2 as upstream. Afaict git head still shows
the problem. [Fedora ships the attached patch, but they are not
upstream, are they?]

cu andreas
-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
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;

Reply via email to