Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Mar 2010 19:42:29 GMT
From:      Xin LI <delphij@freebsd.org>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        gnome@freebsd.org
Subject:   [PATCH] Fix ABI abuse in libxml2
Message-ID:  <201003171942.o2HJgTnJ019899@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Submitter-Id:	current-users
>Originator:	Xin LI
>Organization:	iXsystems, Inc.
>Confidential:	no
>Synopsis:	[PATCH] Fix ABI abuse in libxml2
>Severity:	critical
>Priority:	high
>Category:	ports
>Class:		sw-bug
>Release:	FreeBSD 8.0-STABLE i386
>Environment:
System: FreeBSD freefall.freebsd.org 8.0-STABLE FreeBSD 8.0-STABLE #42 r204803: Sat Mar 6 21:21:56 UTC 2010 simon@freefall.freebsd.org:/usr/src/sys/i386/compile/FREEFALL i386


>Description:
	libxml2 knows too much about zlib's internals.  With the upcoming
update, it would break.

	I'm thinking about making the -STABLE zlib use a different ABI but
the real fix is to use gzdirect() instead of twiddling with zlib internal
bits.
>How-To-Repeat:
	Update base system zlib to 1.2.4 and everything using libxml2 to read
configuration would be broken.
>Fix:


--- libxml2.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/textproc/libxml2/Makefile,v
retrieving revision 1.162
diff -u -p -r1.162 Makefile
--- Makefile	1 Dec 2009 09:48:07 -0000	1.162
+++ Makefile	17 Mar 2010 19:35:36 -0000
@@ -12,7 +12,7 @@
 
 PORTNAME=	libxml2
 PORTVERSION=	2.7.6
-PORTREVISION?=	1
+PORTREVISION?=	2
 CATEGORIES?=	textproc gnome
 MASTER_SITES=	ftp://fr.rpmfind.net/pub/libxml/ \
 		ftp://gd.tuwien.ac.at/pub/libxml/ \
Index: files/patch-xmlIO.c
===================================================================
RCS file: files/patch-xmlIO.c
diff -N files/patch-xmlIO.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-xmlIO.c	17 Mar 2010 19:35:06 -0000
@@ -0,0 +1,20 @@
+--- ./xmlIO.c.orig	2009-09-24 08:32:00.000000000 -0700
++++ ./xmlIO.c	2010-03-17 12:35:00.957293884 -0700
+@@ -2518,6 +2518,9 @@
+ #ifdef HAVE_ZLIB_H
+ 	if ((xmlInputCallbackTable[i].opencallback == xmlGzfileOpen) &&
+ 		(strcmp(URI, "-") != 0)) {
++#if defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1230
++	    ret->compressed = !gzdirect(context);
++#else
+ 	    if (((z_stream *)context)->avail_in > 4) {
+ 	        char *cptr, buff4[4];
+ 		cptr = (char *) ((z_stream *)context)->next_in;
+@@ -2529,6 +2532,7 @@
+ 		    gzrewind(context);
+ 		}
+ 	    }
++#endif
+ 	}
+ #endif
+     }
--- libxml2.diff ends here ---





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003171942.o2HJgTnJ019899>