[SCM] Debian packaging of libxml-libxml-perl branch, master, updated. debian/1.98+dfsg-1-5-gb57e3bc

gregor herrmann gregoa at debian.org
Mon May 21 21:17:03 UTC 2012


The following commit has been merged in the master branch:
commit afdc9341b2e5b2e05ec5bb6af07ab8455213e8a1
Author: gregor herrmann <gregoa at debian.org>
Date:   Mon May 21 23:07:59 2012 +0200

    Add patch 0001-Fix-test-failures-on-64-bit-big-endian-platforms.patch:
    
    use an 'int' instead of STRLEN to avoid variable corruption on big endian
    platforms.
    
    Thanks: Niko Tyni for the patch.
    Closes: #673590

diff --git a/debian/patches/0001-Fix-test-failures-on-64-bit-big-endian-platforms.patch b/debian/patches/0001-Fix-test-failures-on-64-bit-big-endian-platforms.patch
new file mode 100644
index 0000000..46784ff
--- /dev/null
+++ b/debian/patches/0001-Fix-test-failures-on-64-bit-big-endian-platforms.patch
@@ -0,0 +1,53 @@
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/673590
+Forwarded: no
+
+From 99f67c5d0e13912c824b7d93ff4303524bd9cb54 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni at debian.org>
+Date: Sun, 20 May 2012 22:32:31 +0300
+Subject: [PATCH] Fix test failures on 64-bit big endian platforms
+
+As seen in <http://bugs.debian.org/673590>, t/12html.t is crashing
+on 64-bit big endian platforms with
+
+>  Out of memory!
+>  # Looks like you planned 43 tests but ran 41.
+>  # Looks like your test exited with 1 just after 41.
+>  t/12html.t ..........................
+>  Dubious, test returned 1 (wstat 256, 0x100)
+>  Failed 2/43 subtests
+
+STRLEN has 64 bits here and int has 32, so the (int*) cast in
+XML::LibXML::Document::toStringHTML() makes htmlDocDumpMemory() store
+the 32-bit length of the result into a 64-bit variable.  Depending on
+the endianness, it either works OK (LE) or corrupts the variable (BE)
+
+Just use an 'int' instead, and cast it to an STRLEN later in the
+newSVpvn() call.
+---
+ LibXML.xs |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/LibXML.xs b/LibXML.xs
+index 8ac23bf..581cc48 100644
+--- a/LibXML.xs
++++ b/LibXML.xs
+@@ -2930,13 +2930,13 @@ toStringHTML(self)
+        XML::LibXML::Document::serialize_html = 1
+     PREINIT:
+         xmlChar *result=NULL;
+-        STRLEN len = 0;
++        int len = 0;
+         PREINIT_SAVED_ERROR
+     CODE:
+         PERL_UNUSED_VAR(ix);
+         xs_warn( "use no formated toString!" );
+         INIT_ERROR_HANDLER;
+-        htmlDocDumpMemory(self, &result, (int*)&len);
++        htmlDocDumpMemory(self, &result, &len);
+         CLEANUP_ERROR_HANDLER;
+         REPORT_ERROR(0);
+ 
+-- 
+1.7.10
+
diff --git a/debian/patches/series b/debian/patches/series
index 732376f..d0b30a9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 fix-spelling-errors.patch
 dont-link-to-zlib.patch
+0001-Fix-test-failures-on-64-bit-big-endian-platforms.patch

-- 
Debian packaging of libxml-libxml-perl



More information about the Pkg-perl-cvs-commits mailing list