Wed May 25 19:07:29 2016 UTC ()
Pullup ticket #5028 - requested by he
textproc/libxml2: security update

Revisions pulled up:
- textproc/libxml2/Makefile                                     1.141
- textproc/libxml2/distinfo                                     1.110-1.112
- textproc/libxml2/patches/patch-aa                             1.29
- textproc/libxml2/patches/patch-ab                             1.29-1.30
- textproc/libxml2/patches/patch-ac                             1.9
- textproc/libxml2/patches/patch-ad                             1.19
- textproc/libxml2/patches/patch-ae                             1.15
- textproc/libxml2/patches/patch-ag                             deleted
- textproc/libxml2/patches/patch-encoding.c                     added at 1.2
- textproc/libxml2/patches/patch-runtest.c                      added at 1.2
- textproc/libxml2/patches/patch-testlimits.c                   added at 1.2
- textproc/libxml2/patches/patch-timsort.h                      added at 1.2
- textproc/libxml2/patches/patch-xmlIO.c                        added at 1.2

-------------------------------------------------------------------
   Module Name:	pkgsrc
   Committed By:	he
   Date:		Tue May 24 12:00:08 UTC 2016

   Modified Files:
   	pkgsrc/textproc/libxml2: Makefile distinfo
   	pkgsrc/textproc/libxml2/patches: patch-aa patch-ab patch-ac patch-ad
   	    patch-ae
   Added Files:
   	pkgsrc/textproc/libxml2/patches: patch-encoding.c patch-runtest.c
   	    patch-testlimits.c patch-timsort.h patch-xmlIO.c
   Removed Files:
   	pkgsrc/textproc/libxml2/patches: patch-ag

   Log Message:
   Update libxml2 to 2.9.4.

   Pkgsrc changes:
    * Add some casts to match types and format strings, plus
      fix value range of toupper() operation.
    * Merge patch-ag into the new patch-encoding.c.
    * Add comments to existing patches which lacked comments.

   Upstream changes to libxml2-2.9.4: May 23 2016

   Security:

      CVE-2016-3627 Avoid building recursive entities
      CVE-2016-1833 Heap-based buffer overread in htmlCurrentChar
      CVE-2016-1835 Heap use-after-free in xmlSAX2AttributeNs
      CVE-2016-1837 Heap use-after-free in htmlParsePubidLiteral
      	      	 and htmlParseSystemiteral
      CVE-2016-1836 Bug 759398: Heap use-after-free in xmlDictComputeFastKey
      CVE-2016-1839 Bug 758605: Heap-based buffer overread in xmlDictAddString
      CVE-2016-1838 Bug 758588: Heap-based buffer overread in
   	      	 xmlParserPrintFileContextInternal
      CVE-2016-1840 Bug 757711: heap-buffer-overflow in xmlFAParsePosCharGroup
      CVE-2016-4483 Avoid an out of bound access when serializing
      		 malformed strings
      CVE-2016-1834 Bug 763071: heap-buffer-overflow in xmlStrncat
      CVE-2016-3705 Add missing increments of recursion depth counter to
      		 XML parser.
      CVE-2016-1762 Heap-based buffer overread in xmlNextChar

      More format string warnings with possible format string vulnerability
      Heap-based buffer-underreads due to xmlParseName
      Fix some format string warnings with possible format string vulnerability
      Unsigned addition may overflow in xmlMallocAtomicLoc()

   Other bugfixes:

      Detect change of encoding when parsing HTML names
      Fix inappropriate fetch of entities content
      Correct the usage of LDFLAGS
      Revert the use of SAVE_LDFLAGS in configure.ac
      libxml2 hardcodes -L/lib in zlib/lzma tests which breaks cross-compiles
      Add more debugging info to runtest
      Implement "runtest -u" mode
      Integer signed/unsigned type mismatch in xmlParserInputGrow()
      Integer overflow parsing port number in URI
      Fix apibuild for a recently added constructv2.9.4-rc2
      Use pkg-config to locate zlib when possible
      Use pkg-config to locate ICU when possible
      Fix an error with regexp on nullable counted char transition
      Fix memory leak with XPath namespace nodes
      Fix namespace axis traversal
      Add a make rule to rebuild for ASAN
      Fix null pointer deref in docs with no root element
      Portability to non C99 compliant compilers
      dict.h: Move xmlDictPtr definition before includes to allow direct
        inclusion.
      Fix XSD validation of URIs with ampersands
      xmlschemastypes.c: accept endOfDayFrag Times set to "24:00:00" mean
        "end of day" and should not cause an error. v2.9.4-rc1
      os400: tell about xmllint and xmlcatalog in README400.
      os400: properly process SGML add in XMLCATALOG command.
      os400: implement CL command XMLCATALOG.
      os400: compile and install program xmlcatalog (qshell-only).
      xmlcatalog: flush stdout before interactive shell input.
      os400: expand tabs in sources, strip trailing blanks.
      os400: implement CL command XMLLINT.
      os400: compile and install program xmllint (qshell-only).
      os400: initscript make_module(): Use options instead of
        positional parameters.
      xmllint: flush stdout before interactive shell input.
      os400: c14n.rpgle: allow *omit for nullable reference parameters.
      os400: use like() for double type.
      os400: use like() for int type.
      os400: use like() for unsigned int type.
      os400: use like() for enum types.
      Add xz to xml2-config --libs output
      Don't recurse into OP_VALUEs in xmlXPathOptimizeExpression
      Fix namespace::node() XPath expression
      Fix OOB write in xmlXPathEmptyNodeSet
      Fix parsing of NCNames in XPath
      Fix OOB read with invalid UTF-8 in xmlUTF8Strsize
      Do normalize string-based datatype value in RelaxNG facet checking
      Fix typo: s{ ec -> cr }cipt
      Fix typos: dictio{ nn -> n }ar{y,ies}
      Fix typos: PATH_{ SEAPARATOR -> SEPARATOR }
      Correct a typo.
      Bug 760921: REGRESSION (8eb55d78): doc/examples/io1 test fails after fix
        for "xmlSaveUri() incorrectly recomposes URIs with rootless paths"
      Bug 760861: REGRESSION (bf9c1dad): Missing results for
        test/schemas/regexp-char-ref_[01].xsd
      error.c: *input->cur == 0 does not mean no error
      Add missing RNG test files
      Bug 760190: configure.ac should be able to build --with-icu without
        icu-config tool
      Bug 760183: REGRESSION (v2.9.3): XML push parser fails with bogus
        UTF-8 encoding error when multi-byte character in large CDATA
        section is split across buffer
      Bug 758572: ASAN crash in make check
      Bug 721158: Missing ICU string when doing --version on xmllint
      python 3: libxml2.c wrappers create Unicode str already
      win32\VC10\config.h and VS 2015
      Add autogen.sh to distrib
      Add configure maintainer mode

   To generate a diff of this commit:
   cvs rdiff -u -r1.140 -r1.141 pkgsrc/textproc/libxml2/Makefile
   cvs rdiff -u -r1.109 -r1.110 pkgsrc/textproc/libxml2/distinfo
   cvs rdiff -u -r1.28 -r1.29 pkgsrc/textproc/libxml2/patches/patch-aa \
       pkgsrc/textproc/libxml2/patches/patch-ab
   cvs rdiff -u -r1.8 -r1.9 pkgsrc/textproc/libxml2/patches/patch-ac
   cvs rdiff -u -r1.18 -r1.19 pkgsrc/textproc/libxml2/patches/patch-ad
   cvs rdiff -u -r1.14 -r1.15 pkgsrc/textproc/libxml2/patches/patch-ae
   cvs rdiff -u -r1.12 -r0 pkgsrc/textproc/libxml2/patches/patch-ag
   cvs rdiff -u -r0 -r1.1 pkgsrc/textproc/libxml2/patches/patch-encoding.c \
       pkgsrc/textproc/libxml2/patches/patch-runtest.c \
       pkgsrc/textproc/libxml2/patches/patch-testlimits.c \
       pkgsrc/textproc/libxml2/patches/patch-timsort.h \
       pkgsrc/textproc/libxml2/patches/patch-xmlIO.c

-------------------------------------------------------------------
   Module Name:	pkgsrc
   Committed By:	wiz
   Date:		Tue May 24 21:08:21 UTC 2016

   Modified Files:
   	pkgsrc/textproc/libxml2: distinfo
   	pkgsrc/textproc/libxml2/patches: patch-encoding.c patch-runtest.c
   	    patch-testlimits.c patch-timsort.h patch-xmlIO.c

   Log Message:
   Add upstream bug report URLs (from he@).

   To generate a diff of this commit:
   cvs rdiff -u -r1.110 -r1.111 pkgsrc/textproc/libxml2/distinfo
   cvs rdiff -u -r1.1 -r1.2 pkgsrc/textproc/libxml2/patches/patch-encoding.c \
       pkgsrc/textproc/libxml2/patches/patch-runtest.c \
       pkgsrc/textproc/libxml2/patches/patch-testlimits.c \
       pkgsrc/textproc/libxml2/patches/patch-timsort.h \
       pkgsrc/textproc/libxml2/patches/patch-xmlIO.c

-------------------------------------------------------------------
   Module Name:	pkgsrc
   Committed By:	he
   Date:		Wed May 25 07:16:36 UTC 2016

   Modified Files:
   	pkgsrc/textproc/libxml2: distinfo
   	pkgsrc/textproc/libxml2/patches: patch-ab

   Log Message:
   Submit the typo part of configure upstream, note the bug-ID.

   To generate a diff of this commit:
   cvs rdiff -u -r1.111 -r1.112 pkgsrc/textproc/libxml2/distinfo
   cvs rdiff -u -r1.29 -r1.30 pkgsrc/textproc/libxml2/patches/patch-ab


(spz)
diff -r1.140 -r1.140.2.1 pkgsrc/textproc/libxml2/Makefile
diff -r1.109 -r1.109.4.1 pkgsrc/textproc/libxml2/distinfo
diff -r1.28 -r1.28.8.1 pkgsrc/textproc/libxml2/patches/patch-aa
diff -r1.28 -r1.28.8.1 pkgsrc/textproc/libxml2/patches/patch-ab
diff -r1.8 -r1.8.8.1 pkgsrc/textproc/libxml2/patches/patch-ac
diff -r1.18 -r1.18.8.1 pkgsrc/textproc/libxml2/patches/patch-ad
diff -r1.14 -r1.14.8.1 pkgsrc/textproc/libxml2/patches/patch-ae
diff -r1.12 -r0 pkgsrc/textproc/libxml2/patches/patch-ag
diff -r0 -r1.2.2.2 pkgsrc/textproc/libxml2/patches/patch-encoding.c
diff -r0 -r1.2.2.2 pkgsrc/textproc/libxml2/patches/patch-runtest.c
diff -r0 -r1.2.2.2 pkgsrc/textproc/libxml2/patches/patch-testlimits.c
diff -r0 -r1.2.2.2 pkgsrc/textproc/libxml2/patches/patch-timsort.h
diff -r0 -r1.2.2.2 pkgsrc/textproc/libxml2/patches/patch-xmlIO.c

cvs diff -r1.140 -r1.140.2.1 pkgsrc/textproc/libxml2/Makefile (expand / switch to unified diff)

--- pkgsrc/textproc/libxml2/Makefile 2016/02/26 10:32:47 1.140
+++ pkgsrc/textproc/libxml2/Makefile 2016/05/25 19:07:28 1.140.2.1
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1# $NetBSD: Makefile,v 1.140 2016/02/26 10:32:47 jperkin Exp $ 1# $NetBSD: Makefile,v 1.140.2.1 2016/05/25 19:07:28 spz Exp $
2 2
3DISTNAME= libxml2-2.9.3 3DISTNAME= libxml2-2.9.4
4CATEGORIES= textproc 4CATEGORIES= textproc
5MASTER_SITES= ftp://xmlsoft.org/libxml2/ \ 5MASTER_SITES= ftp://xmlsoft.org/libxml2/ \
6 http://xmlsoft.org/sources/ 6 http://xmlsoft.org/sources/
7 7
8MAINTAINER= pkgsrc-users@NetBSD.org 8MAINTAINER= pkgsrc-users@NetBSD.org
9HOMEPAGE= http://xmlsoft.org/ 9HOMEPAGE= http://xmlsoft.org/
10COMMENT= XML parser library from the GNOME project 10COMMENT= XML parser library from the GNOME project
11LICENSE= modified-bsd 11LICENSE= modified-bsd
12 12
13USE_FEATURES= glob 13USE_FEATURES= glob
14USE_LIBTOOL= yes 14USE_LIBTOOL= yes
15USE_TOOLS+= gmake 15USE_TOOLS+= gmake
16GNU_CONFIGURE= yes 16GNU_CONFIGURE= yes

cvs diff -r1.109 -r1.109.4.1 pkgsrc/textproc/libxml2/distinfo (expand / switch to unified diff)

--- pkgsrc/textproc/libxml2/distinfo 2015/11/22 23:49:03 1.109
+++ pkgsrc/textproc/libxml2/distinfo 2016/05/25 19:07:28 1.109.4.1
@@ -1,12 +1,16 @@ @@ -1,12 +1,16 @@
1$NetBSD: distinfo,v 1.109 2015/11/22 23:49:03 wiz Exp $ 1$NetBSD: distinfo,v 1.109.4.1 2016/05/25 19:07:28 spz Exp $
2 2
3SHA1 (libxml2-2.9.3.tar.gz) = 0301ce933637e0ceda049047dbefd18714f59b6e 3SHA1 (libxml2-2.9.4.tar.gz) = 958ae70baf186263a4bd801a81dd5d682aedd1db
4RMD160 (libxml2-2.9.3.tar.gz) = 8ffed136daaf3595c306b76c5600ce67b5984e61 4RMD160 (libxml2-2.9.4.tar.gz) = bb59656e0683d64a38a2f1a45ca9d918837e1e56
5SHA512 (libxml2-2.9.3.tar.gz) = 078afa65229de4f23e6538767253fb4f9f61d96cb72e445179c71d536b224d54922f22972a2b71434796f83f8c99f6a46c3b8813cb4582ad9fca696d141e0abb 5SHA512 (libxml2-2.9.4.tar.gz) = f5174ab1a3a0ec0037a47f47aa47def36674e02bfb42b57f609563f84c6247c585dbbb133c056953a5adb968d328f18cbc102eb0d00d48eb7c95478389e5daf9
6Size (libxml2-2.9.3.tar.gz) = 5477112 bytes 6Size (libxml2-2.9.4.tar.gz) = 5374830 bytes
7SHA1 (patch-aa) = 7d1213079cc78c9a28476c49f1283ab1c6af3b34 7SHA1 (patch-aa) = e687eaa9805b855b0c8a944ec5c597bd34954472
8SHA1 (patch-ab) = bf8983fcde35edf0e450209bf07f0fa628f7bd9e 8SHA1 (patch-ab) = d6d6e9a91307da0c7f334b5b9ad432878babd1ac
9SHA1 (patch-ac) = 015a5903a86793bd770f16f251b94e5b2562b3f7 9SHA1 (patch-ac) = 34afe787f6012b460a85be993048e133907a1621
10SHA1 (patch-ad) = fe255e93f9aefd5403d646cd45d9fbdcbd100bd6 10SHA1 (patch-ad) = d65b7e3be9694147e96ce4bb70a1739e2279ba81
11SHA1 (patch-ae) = d479d5a0c8b906de3cbe1c30b100c6f8b1bb9c43 11SHA1 (patch-ae) = 4eede9719724f94402e850ee6d6043a74aaf62b2
12SHA1 (patch-ag) = f037f13ccc4047d4bf824a2091e60ac89b172558 12SHA1 (patch-encoding.c) = 6cf0a7d421828b9f40a4079ee85adb791c54d096
 13SHA1 (patch-runtest.c) = 759fcee959833b33d72e85108f7973859dcba1f6
 14SHA1 (patch-testlimits.c) = 8cba18464b619469abbb8488fd950a32a567be7b
 15SHA1 (patch-timsort.h) = e09118e7c99d53f71c28fe4d54269c4801244959
 16SHA1 (patch-xmlIO.c) = 5efcc5e43a8b3139832ab69af6b5ab94e5a6ad59

cvs diff -r1.28 -r1.28.8.1 pkgsrc/textproc/libxml2/patches/Attic/patch-aa (expand / switch to unified diff)

--- pkgsrc/textproc/libxml2/patches/Attic/patch-aa 2015/04/24 11:32:29 1.28
+++ pkgsrc/textproc/libxml2/patches/Attic/patch-aa 2016/05/25 19:07:28 1.28.8.1
@@ -1,13 +1,15 @@ @@ -1,13 +1,15 @@
1$NetBSD: patch-aa,v 1.28 2015/04/24 11:32:29 spz Exp $ 1$NetBSD: patch-aa,v 1.28.8.1 2016/05/25 19:07:28 spz Exp $
 2
 3Move EXAMPLES_DIR to fit pkgsrc.
2 4
3--- Makefile.in.orig 2014-10-16 07:35:13.000000000 +0000 5--- Makefile.in.orig 2014-10-16 07:35:13.000000000 +0000
4+++ Makefile.in 6+++ Makefile.in
5@@ -835,7 +835,7 @@ cmake_DATA = libxml2-config.cmake 7@@ -835,7 +835,7 @@ cmake_DATA = libxml2-config.cmake
6 # 8 #
7 BASE_DIR = $(datadir)/doc 9 BASE_DIR = $(datadir)/doc
8 DOC_MODULE = libxml2-$(VERSION) 10 DOC_MODULE = libxml2-$(VERSION)
9-EXAMPLES_DIR = $(BASE_DIR)/$(DOC_MODULE)/examples 11-EXAMPLES_DIR = $(BASE_DIR)/$(DOC_MODULE)/examples
10+EXAMPLES_DIR = $(datadir)/examples/libxml2 12+EXAMPLES_DIR = $(datadir)/examples/libxml2
11  13
12 # 14 #
13 # Coverage support, largely borrowed from libvirt 15 # Coverage support, largely borrowed from libvirt

cvs diff -r1.28 -r1.28.8.1 pkgsrc/textproc/libxml2/patches/Attic/patch-ab (expand / switch to unified diff)

--- pkgsrc/textproc/libxml2/patches/Attic/patch-ab 2015/04/24 11:32:29 1.28
+++ pkgsrc/textproc/libxml2/patches/Attic/patch-ab 2016/05/25 19:07:28 1.28.8.1
@@ -1,14 +1,21 @@ @@ -1,14 +1,21 @@
1$NetBSD: patch-ab,v 1.28 2015/04/24 11:32:29 spz Exp $ 1$NetBSD: patch-ab,v 1.28.8.1 2016/05/25 19:07:28 spz Exp $
 2
 3Various configure fixes:
 4 * Add run-path to XML_LIBDIR
 5 * Fix handling of pthreads
 6 * Add portability to OpenBSD, MirBSD, FreeBSD, NetBSD and DragonFly
 7 * Fix test for SAX
 8 Submitted as https://bugzilla.gnome.org/show_bug.cgi?id=766859
2 9
3--- configure.orig 2014-10-16 07:35:12.000000000 +0000 10--- configure.orig 2014-10-16 07:35:12.000000000 +0000
4+++ configure 11+++ configure
5@@ -14349,7 +14349,7 @@ fi 12@@ -14349,7 +14349,7 @@ fi
6 fi 13 fi
7  14
8  15
9-XML_LIBDIR='-L${libdir}' 16-XML_LIBDIR='-L${libdir}'
10+XML_LIBDIR='-Wl,-R${libdir} -L${libdir}' 17+XML_LIBDIR='-Wl,-R${libdir} -L${libdir}'
11 XML_INCLUDEDIR='-I${includedir}/libxml2' 18 XML_INCLUDEDIR='-I${includedir}/libxml2'
12  19
13 XML_CFLAGS="" 20 XML_CFLAGS=""
14@@ -14822,13 +14822,13 @@ else 21@@ -14822,13 +14822,13 @@ else

cvs diff -r1.8 -r1.8.8.1 pkgsrc/textproc/libxml2/patches/Attic/patch-ac (expand / switch to unified diff)

--- pkgsrc/textproc/libxml2/patches/Attic/patch-ac 2015/04/24 11:32:29 1.8
+++ pkgsrc/textproc/libxml2/patches/Attic/patch-ac 2016/05/25 19:07:28 1.8.8.1
@@ -1,14 +1,16 @@ @@ -1,14 +1,16 @@
1$NetBSD: patch-ac,v 1.8 2015/04/24 11:32:29 spz Exp $ 1$NetBSD: patch-ac,v 1.8.8.1 2016/05/25 19:07:28 spz Exp $
 2
 3Parametrize XML and SGML catalog directories.
2 4
3--- catalog.c.orig 2014-10-03 11:28:05.000000000 +0000 5--- catalog.c.orig 2014-10-03 11:28:05.000000000 +0000
4+++ catalog.c 6+++ catalog.c
5@@ -70,10 +70,10 @@ 7@@ -70,10 +70,10 @@
6 #define XML_URN_PUBID "urn:publicid:" 8 #define XML_URN_PUBID "urn:publicid:"
7 #define XML_CATAL_BREAK ((xmlChar *) -1) 9 #define XML_CATAL_BREAK ((xmlChar *) -1)
8 #ifndef XML_XML_DEFAULT_CATALOG 10 #ifndef XML_XML_DEFAULT_CATALOG
9-#define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog" 11-#define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog"
10+#define XML_XML_DEFAULT_CATALOG "file://@@XML_DEFAULT_CATALOG@@" 12+#define XML_XML_DEFAULT_CATALOG "file://@@XML_DEFAULT_CATALOG@@"
11 #endif 13 #endif
12 #ifndef XML_SGML_DEFAULT_CATALOG 14 #ifndef XML_SGML_DEFAULT_CATALOG
13-#define XML_SGML_DEFAULT_CATALOG "file:///etc/sgml/catalog" 15-#define XML_SGML_DEFAULT_CATALOG "file:///etc/sgml/catalog"
14+#define XML_SGML_DEFAULT_CATALOG "file://@@SGML_DEFAULT_CATALOG@@" 16+#define XML_SGML_DEFAULT_CATALOG "file://@@SGML_DEFAULT_CATALOG@@"

cvs diff -r1.18 -r1.18.8.1 pkgsrc/textproc/libxml2/patches/Attic/patch-ad (expand / switch to unified diff)

--- pkgsrc/textproc/libxml2/patches/Attic/patch-ad 2015/04/24 11:32:29 1.18
+++ pkgsrc/textproc/libxml2/patches/Attic/patch-ad 2016/05/25 19:07:28 1.18.8.1
@@ -1,13 +1,15 @@ @@ -1,13 +1,15 @@
1$NetBSD: patch-ad,v 1.18 2015/04/24 11:32:29 spz Exp $ 1$NetBSD: patch-ad,v 1.18.8.1 2016/05/25 19:07:28 spz Exp $
 2
 3Parametrize SGML catalog directory.
2 4
3--- xmlcatalog.c.orig 2014-10-03 11:28:06.000000000 +0000 5--- xmlcatalog.c.orig 2014-10-03 11:28:06.000000000 +0000
4+++ xmlcatalog.c 6+++ xmlcatalog.c
5@@ -43,7 +43,7 @@ static char *filename = NULL; 7@@ -43,7 +43,7 @@ static char *filename = NULL;
6  8
7  9
8 #ifndef XML_SGML_DEFAULT_CATALOG 10 #ifndef XML_SGML_DEFAULT_CATALOG
9-#define XML_SGML_DEFAULT_CATALOG "/etc/sgml/catalog" 11-#define XML_SGML_DEFAULT_CATALOG "/etc/sgml/catalog"
10+#define XML_SGML_DEFAULT_CATALOG "@@SGML_DEFAULT_CATALOG@@" 12+#define XML_SGML_DEFAULT_CATALOG "@@SGML_DEFAULT_CATALOG@@"
11 #endif 13 #endif
12  14
13 /************************************************************************ 15 /************************************************************************

cvs diff -r1.14 -r1.14.8.1 pkgsrc/textproc/libxml2/patches/Attic/patch-ae (expand / switch to unified diff)

--- pkgsrc/textproc/libxml2/patches/Attic/patch-ae 2015/04/24 11:32:29 1.14
+++ pkgsrc/textproc/libxml2/patches/Attic/patch-ae 2016/05/25 19:07:28 1.14.8.1
@@ -1,13 +1,15 @@ @@ -1,13 +1,15 @@
1$NetBSD: patch-ae,v 1.14 2015/04/24 11:32:29 spz Exp $ 1$NetBSD: patch-ae,v 1.14.8.1 2016/05/25 19:07:28 spz Exp $
 2
 3Don't install html files.
2 4
3--- doc/examples/Makefile.in.orig 2014-10-16 07:35:13.000000000 +0000 5--- doc/examples/Makefile.in.orig 2014-10-16 07:35:13.000000000 +0000
4+++ doc/examples/Makefile.in 6+++ doc/examples/Makefile.in
5@@ -916,7 +916,7 @@ uninstall-am: 7@@ -916,7 +916,7 @@ uninstall-am:
6  8
7 install-data-local:  9 install-data-local:
8 $(MKDIR_P) $(DESTDIR)$(HTML_DIR) 10 $(MKDIR_P) $(DESTDIR)$(HTML_DIR)
9- -$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) 11- -$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
10+ -$(INSTALL) -m 0644 $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR) 12+ -$(INSTALL) -m 0644 $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
11  13
12 clean-local: 14 clean-local:
13 test -f Makefile.am || rm -f test?.xml 15 test -f Makefile.am || rm -f test?.xml

File Deleted: pkgsrc/textproc/libxml2/patches/Attic/patch-ag

File Added: pkgsrc/textproc/libxml2/patches/patch-encoding.c
$NetBSD: patch-encoding.c,v 1.2.2.2 2016/05/25 19:07:28 spz Exp $

Avoid potential undefined behaviour by casting arg to toupper()
to an appropriate value range.
https://bugzilla.gnome.org/show_bug.cgi?id=766838

Also, on NetBSD, add CP1141 encoding alias.

--- encoding.c.orig	2016-05-23 07:25:25.000000000 +0000
+++ encoding.c
@@ -1018,7 +1018,7 @@ xmlGetEncodingAlias(const char *alias) {
 	return(NULL);
 
     for (i = 0;i < 99;i++) {
-        upper[i] = toupper(alias[i]);
+        upper[i] = toupper((unsigned char)alias[i]);
 	if (upper[i] == 0) break;
     }
     upper[i] = 0;
@@ -1053,7 +1053,7 @@ xmlAddEncodingAlias(const char *name, co
 	return(-1);
 
     for (i = 0;i < 99;i++) {
-        upper[i] = toupper(alias[i]);
+        upper[i] = toupper((unsigned char)alias[i]);
 	if (upper[i] == 0) break;
     }
     upper[i] = 0;
@@ -1155,7 +1155,7 @@ xmlParseCharEncoding(const char* name)
 	name = alias;
 
     for (i = 0;i < 499;i++) {
-        upper[i] = toupper(name[i]);
+        upper[i] = toupper((unsigned char)name[i]);
 	if (upper[i] == 0) break;
     }
     upper[i] = 0;
@@ -1331,7 +1331,7 @@ xmlNewCharEncodingHandler(const char *na
 	return(NULL);
     }
     for (i = 0;i < 499;i++) {
-        upper[i] = toupper(name[i]);
+        upper[i] = toupper((unsigned char)name[i]);
 	if (upper[i] == 0) break;
     }
     upper[i] = 0;
@@ -1433,6 +1433,9 @@ xmlInitCharEncodingHandlers(void) {
     xmlRegisterCharEncodingHandlersISO8859x ();
 #endif
 #endif
+#ifdef __NetBSD__ /* XXX needed by selftest */
+    xmlAddEncodingAlias("CP1141", "IBM-1141");
+#endif
 
 }
 
@@ -1660,7 +1663,7 @@ xmlFindCharEncodingHandler(const char *n
      * Check first for directly registered encoding names
      */
     for (i = 0;i < 99;i++) {
-        upper[i] = toupper(name[i]);
+        upper[i] = toupper((unsigned char)name[i]);
 	if (upper[i] == 0) break;
     }
     upper[i] = 0;

File Added: pkgsrc/textproc/libxml2/patches/Attic/patch-runtest.c
$NetBSD$

Since this is built with C90, and %zu isn't supported then, cast
the size_t argument to long to match the format.
https://bugzilla.gnome.org/show_bug.cgi?id=766839

--- runtest.c.orig	2016-05-23 07:25:25.000000000 +0000
+++ runtest.c
@@ -688,7 +688,7 @@ static int compareFileMem(const char *fi
     }
     if (info.st_size != size) {
         fprintf(stderr, "file %s is %ld bytes, result is %d bytes\n",
-	        filename, info.st_size, size);
+	        filename, (long)info.st_size, size);
         return(-1);
     }
     fd = open(filename, RD_FLAGS);

File Added: pkgsrc/textproc/libxml2/patches/Attic/patch-testlimits.c
$NetBSD$

Since this is built with C90, and %zu isn't supported then, cast
the size_t argument to unsigned long to match the format.
https://bugzilla.gnome.org/show_bug.cgi?id=766839

--- testlimits.c.orig	2016-02-09 10:17:34.000000000 +0000
+++ testlimits.c
@@ -1284,13 +1284,14 @@ saxTest(const char *filename, size_t lim
         if (fail)
             res = 0;
         else {
-            fprintf(stderr, "Failed to parse '%s' %lu\n", filename, limit);
+            fprintf(stderr, "Failed to parse '%s' %lu\n", filename,
+		    (unsigned long)limit);
             res = 1;
         }
     } else {
         if (fail) {
             fprintf(stderr, "Failed to get failure for '%s' %lu\n",
-                    filename, limit);
+                    filename, (unsigned long)limit);
             res = 1;
         } else
             res = 0;
@@ -1339,7 +1340,7 @@ readerTest(const char *filename, size_t 
                         filename, crazy_indx);
             else
                 fprintf(stderr, "Failed to parse '%s' %lu\n",
-                        filename, limit);
+                        filename, (unsigned long)limit);
             res = 1;
         }
     } else {
@@ -1349,7 +1350,7 @@ readerTest(const char *filename, size_t 
                         filename, crazy_indx);
             else
                 fprintf(stderr, "Failed to get failure for '%s' %lu\n",
-                        filename, limit);
+                        filename, (unsigned long)limit);
             res = 1;
         } else
             res = 0;

File Added: pkgsrc/textproc/libxml2/patches/Attic/patch-timsort.h
$NetBSD$

Cast argument (gcc says "unsigned int") to match %lu format.
https://bugzilla.gnome.org/show_bug.cgi?id=766839

--- timsort.h.orig	2016-02-09 10:17:34.000000000 +0000
+++ timsort.h
@@ -323,7 +323,7 @@ static void TIM_SORT_RESIZE(TEMP_STORAGE
     SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
     if (tempstore == NULL)
     {
-      fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * new_size);
+      fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", (unsigned long)(sizeof(SORT_TYPE) * new_size));
       exit(1);
     }
     store->storage = tempstore;

File Added: pkgsrc/textproc/libxml2/patches/Attic/patch-xmlIO.c
$NetBSD$

Since this is built with C90, and %zu isn't supported then, cast
the size_t argument to unsigned long to match the format.
https://bugzilla.gnome.org/show_bug.cgi?id=766839

--- xmlIO.c.orig	2016-05-23 07:25:25.000000000 +0000
+++ xmlIO.c
@@ -1674,7 +1674,7 @@ xmlZMemBuffExtend( xmlZMemBuffPtr buff, 
 	xmlStrPrintf(msg, 500,
 		    "xmlZMemBuffExtend:  %s %lu bytes.\n",
 		    "Allocation failure extending output buffer to",
-		    new_size );
+		    (unsigned long)new_size );
 	xmlIOErr(XML_IO_WRITE, (const char *) msg);
     }