View | Details | Raw Unified | Return to bug 256078 | Differences between
and this patch

Collapse All | Expand All

(-)b/textproc/libxml2/Makefile (-41 / +28 lines)
Lines 1-76 Link Here
1
# Created by: Yukihiro Nakai <Nakai@technologist.com>
1
# Created by: Yukihiro Nakai <Nakai@technologist.com>
2
2
3
PORTNAME=	libxml2
3
PORTNAME=	libxml2
4
DISTVERSION=	2.9.10
4
DISTVERSION=	2.9.12
5
PORTREVISION?=	3
5
CATEGORIES=	textproc gnome
6
CATEGORIES?=	textproc gnome
7
MASTER_SITES=	http://xmlsoft.org/sources/
6
MASTER_SITES=	http://xmlsoft.org/sources/
8
DIST_SUBDIR=	gnome2
7
DIST_SUBDIR=	gnome2
9
8
10
MAINTAINER?=	desktop@FreeBSD.org
9
MAINTAINER?=	desktop@FreeBSD.org
11
COMMENT?=	XML parser library for GNOME
10
COMMENT?=	XML parser library for GNOME
12
11
13
LICENSE=	MIT TRIO
12
LICENSE=	MIT TRIO
14
LICENSE_COMB=	multi
13
LICENSE_COMB=	multi
15
LICENSE_NAME_TRIO=	Trio License
14
LICENSE_NAME_TRIO=	Trio License
16
LICENSE_FILE_MIT=	${WRKSRC}/COPYING
15
LICENSE_FILE_MIT=	${WRKSRC}/COPYING
17
LICENSE_FILE_TRIO=	${FILESDIR}/LICENSE.TRIO
16
LICENSE_FILE_TRIO=	${FILESDIR}/LICENSE.TRIO
18
LICENSE_PERMS_TRIO=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
17
LICENSE_PERMS_TRIO=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
19
18
20
GNU_CONFIGURE=	yes
19
#USES+=		compiler cpe iconv libtool pathfix pkgconfig shebangfix
21
USES+=		compiler cpe iconv libtool pathfix pkgconfig shebangfix
20
USES+=		cmake cpe iconv localbase pkgconfig readline
21
#USES+=		cmake cpe iconv localbase pkgconfig readline shebangfix
22
# shebangfix should be in python port?
22
CPE_VENDOR=	xmlsoft
23
CPE_VENDOR=	xmlsoft
23
USE_LDCONFIG=	yes
24
USE_LDCONFIG=	yes
24
CONFIGURE_ARGS?=--with-iconv=${ICONV_PREFIX} \
25
#SHEBANG_GLOB=	*.py
25
		--with-html-dir=${PREFIX}/share/doc \
26
		--with-html-subdir=${PORTNAME} \
27
		--without-icu \
28
		--with-lzma=/usr \
29
		--without-python
30
INSTALL_TARGET=	install-strip
31
SHEBANG_FILES=	*.py */*.py */*/*.py
32
26
33
PLIST_SUB+=	LIBVERSION=${PORTVERSION}
27
PLIST_SUB+=	LIBVERSION=${DISTVERSION}
28
29
TEST_TARGET=	test
34
30
35
.if !defined(MASTERDIR)
31
.if !defined(MASTERDIR)
36
32
37
OPTIONS_DEFINE=	SCHEMA VALIDATION THREADS MEM_DEBUG XMLLINT_HIST THREAD_ALLOC
33
CMAKE_OFF=	LIBXML2_WITH_PYTHON
38
OPTIONS_DEFAULT=SCHEMA VALIDATION THREADS
39
SCHEMA_DESC=	XML schema support
40
SCHEMA_CONFIGURE_WITH=	schemas
41
VALIDATION_DESC=	Validation support
42
VALIDATION_CONFIGURE_OFF=	--without-valid
43
THREADS_DESC=	Threads support
44
THREADS_CONFIGURE_WITH=	threads
45
MEM_DEBUG_DESC=	Memory debugging (DEVELOPERS ONLY!)
46
MEM_DEBUG_CONFIGURE_WITH=	mem-debug
47
XMLLINT_HIST_DESC=	History for xmllint
48
XMLLINT_HIST_CONFIGURE_WITH=	history
49
THREAD_ALLOC_DESC=	Per-thread memory (DEVELOPERS ONLY!)
50
THREAD_ALLOC_CONFIGURE_WITH=	thread-alloc
51
34
52
.endif # !defined(MASTERDIR)
35
OPTIONS_DEFINE=		MEM_DEBUG SCHEMA TEST THREAD_ALLOC THREADS VALIDATION
36
OPTIONS_DEFAULT=	SCHEMA THREADS VALIDATION
53
37
54
.if !defined(MASTERDIR)
38
MEM_DEBUG_DESC=		Memory debugging (DEVELOPERS ONLY!)
55
post-install:
39
SCHEMA_DESC=		XML schema support
56
	@${RM} -r ${STAGEDIR}${PREFIX}/share/gtk-doc
40
THREAD_ALLOC_DESC=	Per-thread memory (DEVELOPERS ONLY!)
57
.endif
41
VALIDATION_DESC=	Validation support
58
42
59
.include <bsd.port.pre.mk>
43
MEM_DEBUG_CMAKE_BOOL=		LIBXML2_WITH_MEM_DEBUG
44
SCHEMA_CMAKE_BOOL=		LIBXML2_WITH_SCHEMAS
45
TEST_CMAKE_BOOL=		LIBXML2_WITH_TESTS
46
THREAD_ALLOC_CMAKE_BOOL=	LIBXML2_WITH_THREAD_ALLOC
47
THREADS_CMAKE_BOOL=		LIBXML2_WITH_THREADS
48
VALIDATION_CMAKE_BOOL=		LIBXML2_WITH_VALID
60
49
61
post-patch:
50
post-patch:
62
.for d in . doc doc/devhelp doc/examples
63
	@${REINPLACE_CMD} -e '/^install-data-am:/ s|install-data-local||' \
64
		${WRKSRC}/${d}/Makefile.in
65
.endfor
66
.for f in catalog.c xmlcatalog.c xmllint.c doc/xmllint.1
51
.for f in catalog.c xmlcatalog.c xmllint.c doc/xmllint.1
67
	@${REINPLACE_CMD} -e \
52
	@${REINPLACE_CMD} -e \
68
		's|/etc/xml/catalog|${LOCALBASE}/share/xml/catalog|g; \
53
		's|/etc/xml/catalog|${LOCALBASE}/share/xml/catalog|g; \
69
		 s|/etc/sgml/catalog|${LOCALBASE}/share/sgml/catalog|g' \
54
		 s|/etc/sgml/catalog|${LOCALBASE}/share/sgml/catalog|g' \
70
		${WRKSRC}/${f}
55
		${WRKSRC}/${f}
71
.endfor
56
.endfor
72
.if ${CHOSEN_COMPILER_TYPE} == gcc
57
73
	@${REINPLACE_CMD} -e 's/ -Wno-array-bounds//' ${WRKSRC}/configure
58
post-install:
59
	@${RLN} ${STAGEDIR}${PREFIX}/lib/libxml2.so.${DISTVERSION} ${STAGEDIR}${PREFIX}/lib/libxml2.so.2
60
74
.endif
61
.endif
75
62
76
.include <bsd.port.post.mk>
63
.include <bsd.port.mk>
(-)b/textproc/libxml2/distinfo (-11 / +3 lines)
Lines 1-11 Link Here
1
TIMESTAMP = 1602549798
1
TIMESTAMP = 1621677997
2
SHA256 (gnome2/libxml2-2.9.10.tar.gz) = aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f
2
SHA256 (gnome2/libxml2-2.9.12.tar.gz) = c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92
3
SIZE (gnome2/libxml2-2.9.10.tar.gz) = 5624761
3
SIZE (gnome2/libxml2-2.9.12.tar.gz) = 5681632
4
SHA256 (gnome2/7ffcd44d7e6c46704f8af0321d9314cd26e0e18a.patch) = 8bab1a7fcc22a8f9a3f89648660bbca424196d82967e213bd27c1dcc9a9544a5
5
SIZE (gnome2/7ffcd44d7e6c46704f8af0321d9314cd26e0e18a.patch) = 1015
6
SHA256 (gnome2/0e1a49c8907645d2e155f0d89d4d9895ac5112b5.patch) = 4a1dca36e762a0e2affb0779918fbf1665a00d984ffbd3efa45d3d202f87ea8c
7
SIZE (gnome2/0e1a49c8907645d2e155f0d89d4d9895ac5112b5.patch) = 996
8
SHA256 (gnome2/50f06b3efb638efb0abd95dc62dca05ae67882c2.patch) = 701048e726e2f3f7f2a71a7054030fc154b5edace72e23c5934ecd9ee09ad811
9
SIZE (gnome2/50f06b3efb638efb0abd95dc62dca05ae67882c2.patch) = 1052
10
SHA256 (gnome2/edc7b6abb0c125eeb888748c334897f60aab0854.patch) = eac708cc0bcb19c59c63874e5518f9084b177c8a10981539d90ba41d9e8414a1
11
SIZE (gnome2/edc7b6abb0c125eeb888748c334897f60aab0854.patch) = 3019
(-)b/textproc/libxml2/files/patch-CMakeLists.txt (+62 lines)
Added Link Here
1
--- CMakeLists.txt.orig	2021-05-13 12:53:51 UTC
2
+++ CMakeLists.txt
3
@@ -1,6 +1,6 @@
4
 cmake_minimum_required(VERSION 3.15)
5
 
6
-project(libxml2 VERSION 2.9.10 LANGUAGES C)
7
+project(libxml2 VERSION 2.9.12 LANGUAGES C)
8
 
9
 include(CheckCSourceCompiles)
10
 include(CheckFunctionExists)
11
@@ -659,12 +659,12 @@ install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DAT
12
 
13
 configure_package_config_file(
14
 	libxml2-config.cmake.cmake.in libxml2-config.cmake
15
-	INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
16
+	INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2
17
 )
18
 
19
 install(
20
 	FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config.cmake
21
-	DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
22
+	DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2
23
 	COMPONENT development
24
 )
25
 
26
@@ -676,13 +676,13 @@ write_basic_package_version_file(
27
 
28
 install(
29
 	FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config-version.cmake
30
-	DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
31
+	DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2
32
 	COMPONENT development
33
 )
34
 
35
 install(
36
 	EXPORT LibXml2
37
-	DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
38
+	DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2
39
 	NAMESPACE LibXml2::
40
 	FILE libxml2-export.cmake
41
 	COMPONENT development
42
@@ -709,18 +709,17 @@ set(XML_PRIVATE_LIBS "${Z_LIBS} ${LZMA_LIBS} ${THREAD_
43
 file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}")
44
 string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}")
45
 
46
-set(prefix "\${pcfiledir}/${PACKAGE_RELATIVE_PATH}")
47
+set(prefix "${CMAKE_INSTALL_PREFIX}")
48
 set(exec_prefix "\${prefix}")
49
 set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
50
 set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
51
 configure_file(libxml-2.0.pc.in libxml-2.0.pc @ONLY)
52
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml-2.0.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development)
53
 
54
-set(prefix "\$(cd \"\$(dirname \"\$0\")\"; pwd -P)/..")
55
 configure_file(xml2-config.in xml2-config @ONLY)
56
 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xml2-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development)
57
 
58
-set(XML_INCLUDEDIR "-I${CMAKE_INSTALL_FULL_INCLUDEDIR}/libxml2")
59
+set(XML_INCLUDEDIR "-I${CMAKE_INSTALL_FULL_INCLUDEDIR}/libxml2 -I${CMAKE_INSTALL_OLDINCLUDEDIR}")
60
 set(XML_LIBDIR "-L${CMAKE_INSTALL_FULL_LIBDIR}")
61
 configure_file(xml2Conf.sh.in xml2Conf.sh @ONLY)
62
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/xml2Conf.sh DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development)
(-)a/textproc/libxml2/files/patch-CVE-2019-20388 (-33 lines)
Removed Link Here
1
From 7ffcd44d7e6c46704f8af0321d9314cd26e0e18a Mon Sep 17 00:00:00 2001
2
From: Zhipeng Xie <xiezhipeng1@huawei.com>
3
Date: Tue, 20 Aug 2019 16:33:06 +0800
4
Subject: [PATCH] Fix memory leak in xmlSchemaValidateStream
5
6
When ctxt->schema is NULL, xmlSchemaSAXPlug->xmlSchemaPreRun
7
alloc a new schema for ctxt->schema and set vctxt->xsiAssemble
8
to 1. Then xmlSchemaVStart->xmlSchemaPreRun initialize
9
vctxt->xsiAssemble to 0 again which cause the alloced schema
10
can not be freed anymore.
11
12
Found with libFuzzer.
13
14
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
15
---
16
 xmlschemas.c | 1 -
17
 1 file changed, 1 deletion(-)
18
19
diff --git a/xmlschemas.c b/xmlschemas.c
20
index 301c8449..39d92182 100644
21
--- xmlschemas.c
22
+++ xmlschemas.c
23
@@ -28090,7 +28090,6 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
24
     vctxt->nberrors = 0;
25
     vctxt->depth = -1;
26
     vctxt->skipDepth = -1;
27
-    vctxt->xsiAssemble = 0;
28
     vctxt->hasKeyrefs = 0;
29
 #ifdef ENABLE_IDC_NODE_TABLES_TEST
30
     vctxt->createIDCNodeTables = 1;
31
-- 
32
GitLab
33
(-)a/textproc/libxml2/files/patch-CVE-2020-24977 (-36 lines)
Removed Link Here
1
From 50f06b3efb638efb0abd95dc62dca05ae67882c2 Mon Sep 17 00:00:00 2001
2
From: Nick Wellnhofer <wellnhofer@aevum.de>
3
Date: Fri, 7 Aug 2020 21:54:27 +0200
4
Subject: [PATCH] Fix out-of-bounds read with 'xmllint --htmlout'
5
6
Make sure that truncated UTF-8 sequences don't cause an out-of-bounds
7
array access.
8
9
Thanks to @SuhwanSong and the Agency for Defense Development (ADD) for
10
the report.
11
12
Fixes #178.
13
---
14
 xmllint.c | 6 ++++++
15
 1 file changed, 6 insertions(+)
16
17
diff --git a/xmllint.c b/xmllint.c
18
index f6a8e463..c647486f 100644
19
--- xmllint.c
20
+++ xmllint.c
21
@@ -528,6 +528,12 @@ static void
22
 xmlHTMLEncodeSend(void) {
23
     char *result;
24
 
25
+    /*
26
+     * xmlEncodeEntitiesReentrant assumes valid UTF-8, but the buffer might
27
+     * end with a truncated UTF-8 sequence. This is a hack to at least avoid
28
+     * an out-of-bounds read.
29
+     */
30
+    memset(&buffer[sizeof(buffer)-4], 0, 4);
31
     result = (char *) xmlEncodeEntitiesReentrant(NULL, BAD_CAST buffer);
32
     if (result) {
33
 	xmlGenericError(xmlGenericErrorContext, "%s", result);
34
-- 
35
GitLab
36
(-)a/textproc/libxml2/files/patch-CVE-2020-7595 (-32 lines)
Removed Link Here
1
From 0e1a49c8907645d2e155f0d89d4d9895ac5112b5 Mon Sep 17 00:00:00 2001
2
From: Zhipeng Xie <xiezhipeng1@huawei.com>
3
Date: Thu, 12 Dec 2019 17:30:55 +0800
4
Subject: [PATCH] Fix infinite loop in xmlStringLenDecodeEntities
5
6
When ctxt->instate == XML_PARSER_EOF,xmlParseStringEntityRef
7
return NULL which cause a infinite loop in xmlStringLenDecodeEntities
8
9
Found with libFuzzer.
10
11
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
12
---
13
 parser.c | 3 ++-
14
 1 file changed, 2 insertions(+), 1 deletion(-)
15
16
diff --git a/parser.c b/parser.c
17
index d1c31963..a34bb6cd 100644
18
--- parser.c
19
+++ parser.c
20
@@ -2646,7 +2646,8 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
21
     else
22
         c = 0;
23
     while ((c != 0) && (c != end) && /* non input consuming loop */
24
-	   (c != end2) && (c != end3)) {
25
+           (c != end2) && (c != end3) &&
26
+           (ctxt->instate != XML_PARSER_EOF)) {
27
 
28
 	if (c == 0) break;
29
         if ((c == '&') && (str[1] == '#')) {
30
-- 
31
GitLab
32
(-)a/textproc/libxml2/files/patch-Makefile.in (-29 lines)
Removed Link Here
1
--- Makefile.in.orig	2019-11-16 14:42:34 UTC
2
+++ Makefile.in
3
@@ -1284,7 +1284,7 @@ am--depfiles: $(am__depfiles_remade)
4
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
5
 
6
 .c.lo:
7
-@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
8
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -fPIC -DPIC -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
9
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
10
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
11
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
12
@@ -1773,7 +1773,7 @@ check-am: all-am
13
 	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
14
 check: $(BUILT_SOURCES)
15
 	$(MAKE) $(AM_MAKEFLAGS) check-recursive
16
-all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \
17
+all-am: Makefile $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \
18
 		config.h
19
 install-binPROGRAMS: install-libLTLIBRARIES
20
 
21
@@ -1910,7 +1910,7 @@ info: info-recursive
22
 
23
 info-am:
24
 
25
-install-data-am: install-cmakeDATA install-data-local \
26
+install-data-am: install-cmakeDATA \
27
 	install-m4dataDATA install-man install-pkgconfigDATA
28
 
29
 install-dvi: install-dvi-recursive
(-)a/textproc/libxml2/files/patch-Python-39-support (-92 lines)
Removed Link Here
1
From edc7b6abb0c125eeb888748c334897f60aab0854 Mon Sep 17 00:00:00 2001
2
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
3
Date: Fri, 28 Feb 2020 12:48:14 +0100
4
Subject: [PATCH] Parenthesize Py<type>_Check() in ifs
5
6
In C, if expressions should be parenthesized.
7
PyLong_Check, PyUnicode_Check etc. happened to expand to a parenthesized
8
expression before, but that's not API to rely on.
9
10
Since Python 3.9.0a4 it needs to be parenthesized explicitly.
11
12
Fixes https://gitlab.gnome.org/GNOME/libxml2/issues/149
13
---
14
 python/libxml.c |  4 ++--
15
 python/types.c  | 12 ++++++------
16
 2 files changed, 8 insertions(+), 8 deletions(-)
17
18
diff --git a/python/libxml.c b/python/libxml.c
19
index bc676c4e..81e709f3 100644
20
--- python/libxml.c
21
+++ python/libxml.c
22
@@ -294,7 +294,7 @@ xmlPythonFileReadRaw (void * context, char * buffer, int len) {
23
 	lenread = PyBytes_Size(ret);
24
 	data = PyBytes_AsString(ret);
25
 #ifdef PyUnicode_Check
26
-    } else if PyUnicode_Check (ret) {
27
+    } else if (PyUnicode_Check (ret)) {
28
 #if PY_VERSION_HEX >= 0x03030000
29
         Py_ssize_t size;
30
 	const char *tmp;
31
@@ -359,7 +359,7 @@ xmlPythonFileRead (void * context, char * buffer, int len) {
32
 	lenread = PyBytes_Size(ret);
33
 	data = PyBytes_AsString(ret);
34
 #ifdef PyUnicode_Check
35
-    } else if PyUnicode_Check (ret) {
36
+    } else if (PyUnicode_Check (ret)) {
37
 #if PY_VERSION_HEX >= 0x03030000
38
         Py_ssize_t size;
39
 	const char *tmp;
40
diff --git a/python/types.c b/python/types.c
41
index c2bafeb1..ed284ec7 100644
42
--- python/types.c
43
+++ python/types.c
44
@@ -602,16 +602,16 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
45
     if (obj == NULL) {
46
         return (NULL);
47
     }
48
-    if PyFloat_Check (obj) {
49
+    if (PyFloat_Check (obj)) {
50
         ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj));
51
-    } else if PyLong_Check(obj) {
52
+    } else if (PyLong_Check(obj)) {
53
 #ifdef PyLong_AS_LONG
54
         ret = xmlXPathNewFloat((double) PyLong_AS_LONG(obj));
55
 #else
56
         ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj));
57
 #endif
58
 #ifdef PyBool_Check
59
-    } else if PyBool_Check (obj) {
60
+    } else if (PyBool_Check (obj)) {
61
 
62
         if (obj == Py_True) {
63
           ret = xmlXPathNewBoolean(1);
64
@@ -620,14 +620,14 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
65
           ret = xmlXPathNewBoolean(0);
66
         }
67
 #endif
68
-    } else if PyBytes_Check (obj) {
69
+    } else if (PyBytes_Check (obj)) {
70
         xmlChar *str;
71
 
72
         str = xmlStrndup((const xmlChar *) PyBytes_AS_STRING(obj),
73
                          PyBytes_GET_SIZE(obj));
74
         ret = xmlXPathWrapString(str);
75
 #ifdef PyUnicode_Check
76
-    } else if PyUnicode_Check (obj) {
77
+    } else if (PyUnicode_Check (obj)) {
78
 #if PY_VERSION_HEX >= 0x03030000
79
         xmlChar *str;
80
 	const char *tmp;
81
@@ -650,7 +650,7 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
82
 	ret = xmlXPathWrapString(str);
83
 #endif
84
 #endif
85
-    } else if PyList_Check (obj) {
86
+    } else if (PyList_Check (obj)) {
87
         int i;
88
         PyObject *node;
89
         xmlNodePtr cur;
90
-- 
91
GitLab
92
(-)a/textproc/libxml2/files/patch-config.h.in (-11 lines)
Removed Link Here
1
--- config.h.in.orig	2018-03-05 15:54:17 UTC
2
+++ config.h.in
3
@@ -1,5 +1,8 @@
4
 /* config.h.in.  Generated from configure.ac by autoheader.  */
5
 
6
+/* XXX */
7
+#define HAVE_VFSCANF
8
+
9
 /* Type cast for the gethostbyname() argument */
10
 #undef GETHOSTBYNAME_ARG_CAST
11
 
(-)a/textproc/libxml2/files/patch-configure (-11 lines)
Removed Link Here
1
--- configure.orig	2019-10-30 19:14:22 UTC
2
+++ configure
3
@@ -15525,6 +15525,8 @@ fi
4
 	       fi
5
 	   fi
6
        ;;
7
+       *freebsd*) THREAD_LIBS=""
8
+       ;;
9
     esac
10
     if test "$WITH_THREADS" = "1" ; then
11
 	THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
(-)a/textproc/libxml2/files/patch-git-106757e8c1e26ad9b8c924c7f304074b79e082c5 (-39 lines)
Removed Link Here
1
commit 106757e8c1e26ad9b8c924c7f304074b79e082c5
2
Author: Daniel Cheng <dcheng@google.com>
3
Date:   Fri Apr 10 14:52:03 2020 -0700
4
5
    Guard new calls to xmlValidatePopElement in xml_reader.c
6
    
7
    Closes #154.
8
9
commit 386fb27654b93d9fb2880e03fb508d618a2e66f1
10
Author: Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>
11
Date:   Tue Apr 28 17:00:37 2020 +0200
12
13
    Add LIBXML_VALID_ENABLED to xmlreader
14
    
15
    There are already LIBXML_VALID_ENABLED in this file to guard against
16
    "--without-valid" at "./configure" step, but here they were missing.
17
diff --git xmlreader.c xmlreader.c
18
index 687c8b3c..3fd9aa4c 100644
19
--- xmlreader.c
20
+++ xmlreader.c
21
@@ -2260,14 +2260,18 @@ xmlFreeTextReader(xmlTextReaderPtr reader) {
22
     if (reader->ctxt != NULL) {
23
         if (reader->dict == reader->ctxt->dict)
24
 	    reader->dict = NULL;
25
+#ifdef LIBXML_VALID_ENABLED
26
 	if ((reader->ctxt->vctxt.vstateTab != NULL) &&
27
 	    (reader->ctxt->vctxt.vstateMax > 0)){
28
+#ifdef LIBXML_REGEXP_ENABLED
29
             while (reader->ctxt->vctxt.vstateNr > 0)
30
                 xmlValidatePopElement(&reader->ctxt->vctxt, NULL, NULL, NULL);
31
+#endif /* LIBXML_REGEXP_ENABLED */
32
 	    xmlFree(reader->ctxt->vctxt.vstateTab);
33
 	    reader->ctxt->vctxt.vstateTab = NULL;
34
 	    reader->ctxt->vctxt.vstateMax = 0;
35
 	}
36
+#endif /* LIBXML_VALID_ENABLED */
37
 	if (reader->ctxt->myDoc != NULL) {
38
 	    if (reader->preserve == 0)
39
 		xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc);
(-)a/textproc/libxml2/files/patch-libxml-2.0-uninstalled.pc.in (-9 lines)
Removed Link Here
1
--- libxml-2.0-uninstalled.pc.in.orig	2016-02-09 10:17:32 UTC
2
+++ libxml-2.0-uninstalled.pc.in
3
@@ -8,5 +8,5 @@ Name: libXML
4
 Version: @VERSION@
5
 Description: libXML library version2.
6
 Requires:
7
-Libs: -L${libdir} -lxml2 @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@
8
+Libs: -L${libdir} -lxml2 @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@
9
 Cflags: -I${includedir} @XML_INCLUDEDIR@ @XML_CFLAGS@
(-)a/textproc/libxml2/files/patch-libxml-2.0.pc.in (-9 lines)
Removed Link Here
1
--- libxml-2.0.pc.in.orig	2016-02-09 10:17:32 UTC
2
+++ libxml-2.0.pc.in
3
@@ -9,5 +9,5 @@ Version: @VERSION@
4
 Description: libXML library version2.
5
 Requires:
6
 Libs: -L${libdir} -lxml2
7
-Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@
8
+Libs.private: @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@
9
 Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@
(-)b/textproc/libxml2/pkg-plist (-3 / +3 lines)
Lines 1-62 Link Here
1
bin/xml2-config
1
bin/xml2-config
2
bin/xmlcatalog
2
bin/xmlcatalog
3
bin/xmllint
3
bin/xmllint
4
include/libxml2/libxml/DOCBparser.h
4
include/libxml2/libxml/DOCBparser.h
5
include/libxml2/libxml/HTMLparser.h
5
include/libxml2/libxml/HTMLparser.h
6
include/libxml2/libxml/HTMLtree.h
6
include/libxml2/libxml/HTMLtree.h
7
include/libxml2/libxml/SAX.h
7
include/libxml2/libxml/SAX.h
8
include/libxml2/libxml/SAX2.h
8
include/libxml2/libxml/SAX2.h
9
include/libxml2/libxml/c14n.h
9
include/libxml2/libxml/c14n.h
10
include/libxml2/libxml/catalog.h
10
include/libxml2/libxml/catalog.h
11
include/libxml2/libxml/chvalid.h
11
include/libxml2/libxml/chvalid.h
12
include/libxml2/libxml/debugXML.h
12
include/libxml2/libxml/debugXML.h
13
include/libxml2/libxml/dict.h
13
include/libxml2/libxml/dict.h
14
include/libxml2/libxml/encoding.h
14
include/libxml2/libxml/encoding.h
15
include/libxml2/libxml/entities.h
15
include/libxml2/libxml/entities.h
16
include/libxml2/libxml/globals.h
16
include/libxml2/libxml/globals.h
17
include/libxml2/libxml/hash.h
17
include/libxml2/libxml/hash.h
18
include/libxml2/libxml/list.h
18
include/libxml2/libxml/list.h
19
include/libxml2/libxml/nanoftp.h
19
include/libxml2/libxml/nanoftp.h
20
include/libxml2/libxml/nanohttp.h
20
include/libxml2/libxml/nanohttp.h
21
include/libxml2/libxml/parser.h
21
include/libxml2/libxml/parser.h
22
include/libxml2/libxml/parserInternals.h
22
include/libxml2/libxml/parserInternals.h
23
include/libxml2/libxml/pattern.h
23
include/libxml2/libxml/pattern.h
24
include/libxml2/libxml/relaxng.h
24
include/libxml2/libxml/relaxng.h
25
include/libxml2/libxml/schemasInternals.h
25
include/libxml2/libxml/schemasInternals.h
26
include/libxml2/libxml/schematron.h
26
include/libxml2/libxml/schematron.h
27
include/libxml2/libxml/threads.h
27
include/libxml2/libxml/threads.h
28
include/libxml2/libxml/tree.h
28
include/libxml2/libxml/tree.h
29
include/libxml2/libxml/uri.h
29
include/libxml2/libxml/uri.h
30
include/libxml2/libxml/valid.h
30
include/libxml2/libxml/valid.h
31
include/libxml2/libxml/xinclude.h
31
include/libxml2/libxml/xinclude.h
32
include/libxml2/libxml/xlink.h
32
include/libxml2/libxml/xlink.h
33
include/libxml2/libxml/xmlIO.h
33
include/libxml2/libxml/xmlIO.h
34
include/libxml2/libxml/xmlautomata.h
34
include/libxml2/libxml/xmlautomata.h
35
include/libxml2/libxml/xmlerror.h
35
include/libxml2/libxml/xmlerror.h
36
include/libxml2/libxml/xmlexports.h
36
include/libxml2/libxml/xmlexports.h
37
include/libxml2/libxml/xmlmemory.h
37
include/libxml2/libxml/xmlmemory.h
38
include/libxml2/libxml/xmlmodule.h
38
include/libxml2/libxml/xmlmodule.h
39
include/libxml2/libxml/xmlreader.h
39
include/libxml2/libxml/xmlreader.h
40
include/libxml2/libxml/xmlregexp.h
40
include/libxml2/libxml/xmlregexp.h
41
include/libxml2/libxml/xmlsave.h
41
include/libxml2/libxml/xmlsave.h
42
include/libxml2/libxml/xmlschemas.h
42
include/libxml2/libxml/xmlschemas.h
43
include/libxml2/libxml/xmlschemastypes.h
43
include/libxml2/libxml/xmlschemastypes.h
44
include/libxml2/libxml/xmlstring.h
44
include/libxml2/libxml/xmlstring.h
45
include/libxml2/libxml/xmlunicode.h
45
include/libxml2/libxml/xmlunicode.h
46
include/libxml2/libxml/xmlversion.h
46
include/libxml2/libxml/xmlversion.h
47
include/libxml2/libxml/xmlwriter.h
47
include/libxml2/libxml/xmlwriter.h
48
include/libxml2/libxml/xpath.h
48
include/libxml2/libxml/xpath.h
49
include/libxml2/libxml/xpathInternals.h
49
include/libxml2/libxml/xpathInternals.h
50
include/libxml2/libxml/xpointer.h
50
include/libxml2/libxml/xpointer.h
51
lib/cmake/libxml2/libxml2-config-version.cmake
52
lib/cmake/libxml2/libxml2-export-%%CMAKE_BUILD_TYPE%%.cmake
53
lib/cmake/libxml2/libxml2-export.cmake
51
lib/cmake/libxml2/libxml2-config.cmake
54
lib/cmake/libxml2/libxml2-config.cmake
52
lib/libxml2.a
53
lib/libxml2.so
55
lib/libxml2.so
54
lib/libxml2.so.2
56
lib/libxml2.so.2
55
lib/libxml2.so.%%LIBVERSION%%
57
lib/libxml2.so.%%LIBVERSION%%
56
lib/xml2Conf.sh
58
lib/xml2Conf.sh
57
libdata/pkgconfig/libxml-2.0.pc
59
libdata/pkgconfig/libxml-2.0.pc
58
share/aclocal/libxml.m4
59
man/man1/xml2-config.1.gz
60
man/man1/xmlcatalog.1.gz
60
man/man1/xmlcatalog.1.gz
61
man/man1/xmllint.1.gz
61
man/man1/xmllint.1.gz
62
man/man3/libxml.3.gz
62
man/man3/libxml.3.gz

Return to bug 256078