ports/144828: [PATCH] Fix ABI abuse in libxml2

Xin LI delphij at FreeBSD.org
Wed Mar 17 19:50:01 UTC 2010


>Number:         144828
>Category:       ports
>Synopsis:       [PATCH] Fix ABI abuse in libxml2
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 17 19:50:00 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Xin LI
>Release:        FreeBSD 8.0-STABLE i386
>Organization:
iXsystems, Inc.
>Environment:
System: FreeBSD freefall.freebsd.org 8.0-STABLE FreeBSD 8.0-STABLE #42 r204803: Sat Mar 6 21:21:56 UTC 2010 simon at 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 ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list