Import of pkgsrc-2016Q3

This commit is contained in:
2016-10-14 07:49:11 +02:00
committed by Lionel Sambuc
parent 9d819b6d54
commit 1242aa1e36
35952 changed files with 949749 additions and 377083 deletions

View File

@@ -1,13 +1,7 @@
# $NetBSD: Makefile,v 1.138 2015/07/03 18:55:46 he Exp $
# $NetBSD: Makefile,v 1.142 2016/05/27 23:51:10 pgoyette Exp $
DISTNAME= libxml2-2.9.2
PKGREVISION= 3
CATEGORIES= textproc
MASTER_SITES= ftp://xmlsoft.org/libxml2/ \
http://xmlsoft.org/sources/
.include "../../textproc/libxml2/Makefile.common"
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://xmlsoft.org/
COMMENT= XML parser library from the GNOME project
LICENSE= modified-bsd
@@ -31,8 +25,6 @@ PKGCONFIG_OVERRIDE= libxml-2.0.pc.in
MAKE_ENV+= PAX=${PAX:Q}
.include "../../mk/bsd.prefs.mk"
TEST_TARGET= check
SUBST_CLASSES+= cat
@@ -41,9 +33,7 @@ SUBST_FILES.cat= catalog.c xmlcatalog.c
SUBST_SED.cat= -e "s,@@SGML_DEFAULT_CATALOG@@,${SGML_DEFAULT_CATALOG},g"
SUBST_SED.cat+= -e "s,@@XML_DEFAULT_CATALOG@@,${XML_DEFAULT_CATALOG},g"
.if ${OPSYS} == "SunOS"
BUILDLINK_TRANSFORM+= rm:-Werror=format=2
.endif
BUILDLINK_TRANSFORM.SunOS+= rm:-Werror=format=2
LDFLAGS.SCO_SV+= -lm

View File

@@ -0,0 +1,12 @@
# $NetBSD: Makefile.common,v 1.2 2016/05/28 06:47:51 wiz Exp $
#
# used by textproc/libxml2/Makefile
# used by textproc/py-libxml2/Makefile
DISTNAME= libxml2-2.9.4
CATEGORIES= textproc
MASTER_SITES= ftp://xmlsoft.org/libxml2/ \
http://xmlsoft.org/sources/
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://xmlsoft.org/

View File

@@ -1,18 +1,16 @@
$NetBSD: distinfo,v 1.107 2015/07/03 18:55:46 he Exp $
$NetBSD: distinfo,v 1.112 2016/05/25 07:16:36 he Exp $
SHA1 (libxml2-2.9.2.tar.gz) = f46a37ea6d869f702e03f393c376760f3cbee673
RMD160 (libxml2-2.9.2.tar.gz) = 969b4ed8782f455fd4a6ca1c1b4ffa7651090070
Size (libxml2-2.9.2.tar.gz) = 5444991 bytes
SHA1 (patch-HTMLparser.c) = 46e062001d8c7688f9c938741dbd53e917169d1f
SHA1 (patch-aa) = 7d1213079cc78c9a28476c49f1283ab1c6af3b34
SHA1 (patch-ab) = bf8983fcde35edf0e450209bf07f0fa628f7bd9e
SHA1 (patch-ac) = 015a5903a86793bd770f16f251b94e5b2562b3f7
SHA1 (patch-ad) = fe255e93f9aefd5403d646cd45d9fbdcbd100bd6
SHA1 (patch-ae) = d479d5a0c8b906de3cbe1c30b100c6f8b1bb9c43
SHA1 (patch-ag) = f037f13ccc4047d4bf824a2091e60ac89b172558
SHA1 (patch-aj) = aab00bf2ba0168fa8f6070db985531c676b5c34d
SHA1 (patch-ba) = 78097bb871cc614c8d95a53d825542d23e113192
SHA1 (patch-buf.c) = 087a768a39441189b226cda500475014462ff8fd
SHA1 (patch-include_libxml_tree.h) = 9978e6a3ea2408a9aaf68fe1663df5f7dce12eee
SHA1 (patch-threads.c) = 425796881df8520356abbfff001f0e6191d9f186
SHA1 (patch-xmlreader.c) = cb8710e4c0261a98a68e3e69388d3a4341629f22
SHA1 (libxml2-2.9.4.tar.gz) = 958ae70baf186263a4bd801a81dd5d682aedd1db
RMD160 (libxml2-2.9.4.tar.gz) = bb59656e0683d64a38a2f1a45ca9d918837e1e56
SHA512 (libxml2-2.9.4.tar.gz) = f5174ab1a3a0ec0037a47f47aa47def36674e02bfb42b57f609563f84c6247c585dbbb133c056953a5adb968d328f18cbc102eb0d00d48eb7c95478389e5daf9
Size (libxml2-2.9.4.tar.gz) = 5374830 bytes
SHA1 (patch-aa) = e687eaa9805b855b0c8a944ec5c597bd34954472
SHA1 (patch-ab) = d6d6e9a91307da0c7f334b5b9ad432878babd1ac
SHA1 (patch-ac) = 34afe787f6012b460a85be993048e133907a1621
SHA1 (patch-ad) = d65b7e3be9694147e96ce4bb70a1739e2279ba81
SHA1 (patch-ae) = 4eede9719724f94402e850ee6d6043a74aaf62b2
SHA1 (patch-encoding.c) = 6cf0a7d421828b9f40a4079ee85adb791c54d096
SHA1 (patch-runtest.c) = 759fcee959833b33d72e85108f7973859dcba1f6
SHA1 (patch-testlimits.c) = 8cba18464b619469abbb8488fd950a32a567be7b
SHA1 (patch-timsort.h) = e09118e7c99d53f71c28fe4d54269c4801244959
SHA1 (patch-xmlIO.c) = 5efcc5e43a8b3139832ab69af6b5ab94e5a6ad59

View File

@@ -1,90 +0,0 @@
$NetBSD: patch-HTMLparser.c,v 1.1 2015/07/03 18:55:46 he Exp $
Suggested patch for arbitrary-memory-access vulnerability, from
https://bugzilla.gnome.org/show_bug.cgi?id=746048
--- HTMLparser.c.orig 2014-10-06 10:48:11.000000000 +0000
+++ HTMLparser.c
@@ -3245,13 +3245,20 @@ htmlParseComment(htmlParserCtxtPtr ctxt)
ctxt->instate = state;
return;
}
+ if ((ctxt->input->end - ctxt->input->cur) < 3) {
+ ctxt->instate = XML_PARSER_EOF;
+ htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
+ "Comment not terminated\n", NULL, NULL);
+ xmlFree(buf);
+ return;
+ }
q = CUR_CHAR(ql);
NEXTL(ql);
r = CUR_CHAR(rl);
NEXTL(rl);
cur = CUR_CHAR(l);
len = 0;
- while (IS_CHAR(cur) &&
+ while (((ctxt->input->end - ctxt->input->cur) > 0) && IS_CHAR(cur) &&
((cur != '>') ||
(r != '-') || (q != '-'))) {
if (len + 5 >= size) {
@@ -3281,7 +3288,7 @@ htmlParseComment(htmlParserCtxtPtr ctxt)
}
}
buf[len] = 0;
- if (!IS_CHAR(cur)) {
+ if (!(ctxt->input->end - ctxt->input->cur) || !IS_CHAR(cur)) {
htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
"Comment not terminated \n<!--%.50s\n", buf, NULL);
xmlFree(buf);
@@ -4465,6 +4472,7 @@ htmlParseContentInternal(htmlParserCtxtP
depth = ctxt->nameNr;
while (1) {
long cons = ctxt->nbChars;
+ long rem = ctxt->input->end - ctxt->input->cur;
GROW;
@@ -4540,7 +4548,7 @@ htmlParseContentInternal(htmlParserCtxtP
/*
* Sometimes DOCTYPE arrives in the middle of the document
*/
- if ((CUR == '<') && (NXT(1) == '!') &&
+ if ((rem >= 9) && (CUR == '<') && (NXT(1) == '!') &&
(UPP(2) == 'D') && (UPP(3) == 'O') &&
(UPP(4) == 'C') && (UPP(5) == 'T') &&
(UPP(6) == 'Y') && (UPP(7) == 'P') &&
@@ -4554,7 +4562,7 @@ htmlParseContentInternal(htmlParserCtxtP
/*
* First case : a comment
*/
- if ((CUR == '<') && (NXT(1) == '!') &&
+ if ((rem >= 4) && (CUR == '<') && (NXT(1) == '!') &&
(NXT(2) == '-') && (NXT(3) == '-')) {
htmlParseComment(ctxt);
}
@@ -4562,14 +4570,14 @@ htmlParseContentInternal(htmlParserCtxtP
/*
* Second case : a Processing Instruction.
*/
- else if ((CUR == '<') && (NXT(1) == '?')) {
+ else if ((rem >= 2) && (CUR == '<') && (NXT(1) == '?')) {
htmlParsePI(ctxt);
}
/*
* Third case : a sub-element.
*/
- else if (CUR == '<') {
+ else if ((rem >= 1) && (CUR == '<')) {
htmlParseElementInternal(ctxt);
if (currentNode != NULL) xmlFree(currentNode);
@@ -4581,7 +4589,7 @@ htmlParseContentInternal(htmlParserCtxtP
* Fourth case : a reference. If if has not been resolved,
* parsing returns it's Name, create the node
*/
- else if (CUR == '&') {
+ else if ((rem >= 1) && (CUR == '&')) {
htmlParseReference(ctxt);
}

View File

@@ -1,4 +1,6 @@
$NetBSD: patch-aa,v 1.28 2015/04/24 11:32:29 spz Exp $
$NetBSD: patch-aa,v 1.29 2016/05/24 12:00:08 he Exp $
Move EXAMPLES_DIR to fit pkgsrc.
--- Makefile.in.orig 2014-10-16 07:35:13.000000000 +0000
+++ Makefile.in

View File

@@ -1,4 +1,11 @@
$NetBSD: patch-ab,v 1.28 2015/04/24 11:32:29 spz Exp $
$NetBSD: patch-ab,v 1.30 2016/05/25 07:16:36 he Exp $
Various configure fixes:
* Add run-path to XML_LIBDIR
* Fix handling of pthreads
* Add portability to OpenBSD, MirBSD, FreeBSD, NetBSD and DragonFly
* Fix test for SAX
Submitted as https://bugzilla.gnome.org/show_bug.cgi?id=766859
--- configure.orig 2014-10-16 07:35:12.000000000 +0000
+++ configure

View File

@@ -1,4 +1,6 @@
$NetBSD: patch-ac,v 1.8 2015/04/24 11:32:29 spz Exp $
$NetBSD: patch-ac,v 1.9 2016/05/24 12:00:08 he Exp $
Parametrize XML and SGML catalog directories.
--- catalog.c.orig 2014-10-03 11:28:05.000000000 +0000
+++ catalog.c

View File

@@ -1,4 +1,6 @@
$NetBSD: patch-ad,v 1.18 2015/04/24 11:32:29 spz Exp $
$NetBSD: patch-ad,v 1.19 2016/05/24 12:00:08 he Exp $
Parametrize SGML catalog directory.
--- xmlcatalog.c.orig 2014-10-03 11:28:06.000000000 +0000
+++ xmlcatalog.c

View File

@@ -1,4 +1,6 @@
$NetBSD: patch-ae,v 1.14 2015/04/24 11:32:29 spz Exp $
$NetBSD: patch-ae,v 1.15 2016/05/24 12:00:08 he Exp $
Don't install html files.
--- doc/examples/Makefile.in.orig 2014-10-16 07:35:13.000000000 +0000
+++ doc/examples/Makefile.in

View File

@@ -1,14 +0,0 @@
$NetBSD: patch-ag,v 1.12 2015/04/24 11:32:29 spz Exp $
--- encoding.c.orig 2014-10-03 11:53:06.000000000 +0000
+++ encoding.c
@@ -1433,6 +1433,9 @@ xmlInitCharEncodingHandlers(void) {
xmlRegisterCharEncodingHandlersISO8859x ();
#endif
#endif
+#ifdef __NetBSD__ /* XXX needed by selftest */
+ xmlAddEncodingAlias("CP1141", "IBM-1141");
+#endif
}

View File

@@ -1,18 +0,0 @@
$NetBSD: patch-aj,v 1.4 2015/04/24 11:32:29 spz Exp $
Inlucde resolv.h conditionally:
https://bugzilla.gnome.org/show_bug.cgi?id=617053
--- nanohttp.c.orig 2014-10-03 11:28:05.000000000 +0000
+++ nanohttp.c
@@ -43,8 +43,10 @@
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
+#ifdef HAVE_RESOLV_H
#include <resolv.h>
#endif
+#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif

View File

@@ -1,27 +0,0 @@
$NetBSD: patch-ba,v 1.3 2014/10/28 18:55:56 drochner Exp $
https://git.gnome.org/browse/libxml2/commit/?id=f65128f38289d77ff322d63aef2858cc0a819c34
https://git.gnome.org/browse/libxml2/commit/?id=72a46a519ce7326d9a00f0b6a7f2a8e958cd1675
--- parser.c.orig 2014-10-16 05:57:40.000000000 +0000
+++ parser.c
@@ -7235,7 +7235,8 @@ xmlParseReference(xmlParserCtxtPtr ctxt)
* far more secure as the parser will only process data coming from
* the document entity by default.
*/
- if ((ent->checked == 0) &&
+ if (((ent->checked == 0) ||
+ ((ent->children == NULL) && (ctxt->options & XML_PARSE_NOENT))) &&
((ent->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY) ||
(ctxt->options & (XML_PARSE_NOENT | XML_PARSE_DTDVALID)))) {
unsigned long oldnbent = ctxt->nbentities;
@@ -14830,9 +14831,6 @@ xmlInitParser(void) {
#ifdef LIBXML_XPATH_ENABLED
xmlXPathInit();
#endif
-#ifdef LIBXML_CATALOG_ENABLED
- xmlInitializeCatalog();
-#endif
xmlParserInitialized = 1;
#ifdef LIBXML_THREAD_ENABLED
}

View File

@@ -1,94 +0,0 @@
$NetBSD: patch-buf.c,v 1.1 2015/04/24 11:32:29 spz Exp $
patch for CVE-2015-1819 Enforce the reader to run in constant memory
from https://git.gnome.org/browse/libxml2/commit/?id=213f1fe0d76d30eaed6e5853057defc43e6df2c9
part 1
--- buf.c.orig 2014-10-13 08:01:31.000000000 +0000
+++ buf.c
@@ -27,6 +27,7 @@
#include <libxml/tree.h>
#include <libxml/globals.h>
#include <libxml/tree.h>
+#include <libxml/parserInternals.h> /* for XML_MAX_TEXT_LENGTH */
#include "buf.h"
#define WITH_BUFFER_COMPAT
@@ -299,7 +300,8 @@ xmlBufSetAllocationScheme(xmlBufPtr buf,
if ((scheme == XML_BUFFER_ALLOC_DOUBLEIT) ||
(scheme == XML_BUFFER_ALLOC_EXACT) ||
(scheme == XML_BUFFER_ALLOC_HYBRID) ||
- (scheme == XML_BUFFER_ALLOC_IMMUTABLE)) {
+ (scheme == XML_BUFFER_ALLOC_IMMUTABLE) ||
+ (scheme == XML_BUFFER_ALLOC_BOUNDED)) {
buf->alloc = scheme;
if (buf->buffer)
buf->buffer->alloc = scheme;
@@ -458,6 +460,18 @@ xmlBufGrowInternal(xmlBufPtr buf, size_t
size = buf->use + len + 100;
#endif
+ if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
+ /*
+ * Used to provide parsing limits
+ */
+ if ((buf->use + len >= XML_MAX_TEXT_LENGTH) ||
+ (buf->size >= XML_MAX_TEXT_LENGTH)) {
+ xmlBufMemoryError(buf, "buffer error: text too long\n");
+ return(0);
+ }
+ if (size >= XML_MAX_TEXT_LENGTH)
+ size = XML_MAX_TEXT_LENGTH;
+ }
if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
size_t start_buf = buf->content - buf->contentIO;
@@ -738,7 +752,15 @@ xmlBufResize(xmlBufPtr buf, size_t size)
return(0);
CHECK_COMPAT(buf)
- if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0);
+ if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
+ /*
+ * Used to provide parsing limits
+ */
+ if (size >= XML_MAX_TEXT_LENGTH) {
+ xmlBufMemoryError(buf, "buffer error: text too long\n");
+ return(0);
+ }
+ }
/* Don't resize if we don't have to */
if (size < buf->size)
@@ -867,6 +889,15 @@ xmlBufAdd(xmlBufPtr buf, const xmlChar *
needSize = buf->use + len + 2;
if (needSize > buf->size){
+ if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
+ /*
+ * Used to provide parsing limits
+ */
+ if (needSize >= XML_MAX_TEXT_LENGTH) {
+ xmlBufMemoryError(buf, "buffer error: text too long\n");
+ return(-1);
+ }
+ }
if (!xmlBufResize(buf, needSize)){
xmlBufMemoryError(buf, "growing buffer");
return XML_ERR_NO_MEMORY;
@@ -938,6 +969,15 @@ xmlBufAddHead(xmlBufPtr buf, const xmlCh
}
needSize = buf->use + len + 2;
if (needSize > buf->size){
+ if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
+ /*
+ * Used to provide parsing limits
+ */
+ if (needSize >= XML_MAX_TEXT_LENGTH) {
+ xmlBufMemoryError(buf, "buffer error: text too long\n");
+ return(-1);
+ }
+ }
if (!xmlBufResize(buf, needSize)){
xmlBufMemoryError(buf, "growing buffer");
return XML_ERR_NO_MEMORY;

View File

@@ -0,0 +1,65 @@
$NetBSD$
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;

View File

@@ -1,18 +0,0 @@
$NetBSD: patch-include_libxml_tree.h,v 1.1 2015/04/24 11:32:29 spz Exp $
patch for CVE-2015-1819 Enforce the reader to run in constant memory
from https://git.gnome.org/browse/libxml2/commit/?id=213f1fe0d76d30eaed6e5853057defc43e6df2c9
part 2
--- include/libxml/tree.h.orig 2014-10-13 08:20:09.000000000 +0000
+++ include/libxml/tree.h
@@ -76,7 +76,8 @@ typedef enum {
XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */
XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */
XML_BUFFER_ALLOC_IO, /* special allocation scheme used for I/O */
- XML_BUFFER_ALLOC_HYBRID /* exact up to a threshold, and doubleit thereafter */
+ XML_BUFFER_ALLOC_HYBRID, /* exact up to a threshold, and doubleit thereafter */
+ XML_BUFFER_ALLOC_BOUNDED /* limit the upper size of the buffer */
} xmlBufferAllocationScheme;
/**

View File

@@ -0,0 +1,17 @@
$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);

View File

@@ -0,0 +1,43 @@
$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;

View File

@@ -1,38 +0,0 @@
$NetBSD: patch-threads.c,v 1.5 2015/04/24 11:32:29 spz Exp $
* Treat OpenBSD and MirBSD same as Linux to avoid linking with libpthread
* NetBSD<4.99.36 and FreeBSD<7.0 lack pthread_equal() stub function in libc
* pthread_once_t cast needed to avoid compilation error
--- threads.c.orig 2014-10-13 07:02:28.000000000 +0000
+++ threads.c
@@ -42,13 +42,17 @@
#include <note.h>
#endif
+#if defined(__NetBSD__)
+#include <sys/param.h>
+#endif
+
/* #define DEBUG_THREADS */
#ifdef HAVE_PTHREAD_H
static int libxml_is_threaded = -1;
#ifdef __GNUC__
-#ifdef linux
+#if defined(linux) || defined(__OpenBSD__) || defined(__MirBSD__)
#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
extern int pthread_once (pthread_once_t *__once_control,
void (*__init_routine) (void))
@@ -90,6 +94,10 @@ extern int pthread_cond_signal ()
#endif
#endif /* linux */
#endif /* __GNUC__ */
+#if (defined(__NetBSD__) && __NetBSD_Version__ < 499003600) || (defined(__FreeBSD__) && __FreeBSD_version < 700000)
+extern int pthread_equal ()
+ __attribute((weak));
+#endif /* NetBSD-4, FreeBSD-6 */
#endif /* HAVE_PTHREAD_H */
/*

View File

@@ -0,0 +1,16 @@
$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;

View File

@@ -0,0 +1,17 @@
$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);
}

View File

@@ -1,59 +0,0 @@
$NetBSD: patch-xmlreader.c,v 1.1 2015/04/24 11:32:29 spz Exp $
patch for CVE-2015-1819 Enforce the reader to run in constant memory
from https://git.gnome.org/browse/libxml2/commit/?id=213f1fe0d76d30eaed6e5853057defc43e6df2c9
part 3
--- xmlreader.c.orig 2014-10-06 12:05:09.000000000 +0000
+++ xmlreader.c
@@ -2091,6 +2091,9 @@ xmlNewTextReader(xmlParserInputBufferPtr
"xmlNewTextReader : malloc failed\n");
return(NULL);
}
+ /* no operation on a reader should require a huge buffer */
+ xmlBufSetAllocationScheme(ret->buffer,
+ XML_BUFFER_ALLOC_BOUNDED);
ret->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
if (ret->sax == NULL) {
xmlBufFree(ret->buffer);
@@ -3616,6 +3619,7 @@ xmlTextReaderConstValue(xmlTextReaderPtr
return(((xmlNsPtr) node)->href);
case XML_ATTRIBUTE_NODE:{
xmlAttrPtr attr = (xmlAttrPtr) node;
+ const xmlChar *ret;
if ((attr->children != NULL) &&
(attr->children->type == XML_TEXT_NODE) &&
@@ -3629,10 +3633,21 @@ xmlTextReaderConstValue(xmlTextReaderPtr
"xmlTextReaderSetup : malloc failed\n");
return (NULL);
}
+ xmlBufSetAllocationScheme(reader->buffer,
+ XML_BUFFER_ALLOC_BOUNDED);
} else
xmlBufEmpty(reader->buffer);
xmlBufGetNodeContent(reader->buffer, node);
- return(xmlBufContent(reader->buffer));
+ ret = xmlBufContent(reader->buffer);
+ if (ret == NULL) {
+ /* error on the buffer best to reallocate */
+ xmlBufFree(reader->buffer);
+ reader->buffer = xmlBufCreateSize(100);
+ xmlBufSetAllocationScheme(reader->buffer,
+ XML_BUFFER_ALLOC_BOUNDED);
+ ret = BAD_CAST "";
+ }
+ return(ret);
}
break;
}
@@ -5131,6 +5146,9 @@ xmlTextReaderSetup(xmlTextReaderPtr read
"xmlTextReaderSetup : malloc failed\n");
return (-1);
}
+ /* no operation on a reader should require a huge buffer */
+ xmlBufSetAllocationScheme(reader->buffer,
+ XML_BUFFER_ALLOC_BOUNDED);
if (reader->sax == NULL)
reader->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
if (reader->sax == NULL) {