From 8653f9c31bea30a7c38db656ef2c1373c5e7056c Mon Sep 17 00:00:00 2001 From: pedro Date: Mon, 4 Dec 2023 12:39:53 +0100 Subject: [PATCH] libxml2: update to 2.11.6 --- release/src-rt-6.x.4708/router/Makefile | 10 +++++----- release/src-rt-6.x.4708/router/libxml2/NEWS | 12 ++++++++++++ release/src-rt-6.x.4708/router/libxml2/configure.ac | 2 +- release/src-rt-6.x.4708/router/libxml2/parser.c | 10 ++++++++-- release/src-rt-6.x.4708/router/libxml2/runtest.c | 4 ++++ release/src-rt-6.x.4708/router/libxml2/xinclude.c | 3 ++- 6 files changed, 32 insertions(+), 9 deletions(-) diff --git a/release/src-rt-6.x.4708/router/Makefile b/release/src-rt-6.x.4708/router/Makefile index 82a7c9e9d2..0c53bfdf7a 100644 --- a/release/src-rt-6.x.4708/router/Makefile +++ b/release/src-rt-6.x.4708/router/Makefile @@ -2383,11 +2383,11 @@ libxml2: libxml2/stamp-h1 @$(MAKE) -C $@ DESTDIR=$(TOP)/libxml2/staged install libxml2-install: - install -D libxml2/.libs/libxml2.so.2.11.5 $(INSTALLDIR)/libxml2/usr/lib/libxml2.so.2.11.5 - $(STRIP) $(INSTALLDIR)/libxml2/usr/lib/libxml2.so.2.11.5 + install -D libxml2/.libs/libxml2.so.2.11.6 $(INSTALLDIR)/libxml2/usr/lib/libxml2.so.2.11.6 + $(STRIP) $(INSTALLDIR)/libxml2/usr/lib/libxml2.so.2.11.6 cd $(INSTALLDIR)/libxml2/usr/lib && \ - ln -sf libxml2.so.2.11.5 libxml2.so.2 && \ - ln -sf libxml2.so.2.11.5 libxml2.so + ln -sf libxml2.so.2.11.6 libxml2.so.2 && \ + ln -sf libxml2.so.2.11.6 libxml2.so libxml2-clean: -@$(MAKE) -C libxml2 clean @@ -3384,7 +3384,7 @@ getdns-clean: tor/stamp-h1: cd tor && autoreconf -fsi && \ CFLAGS="$(if $(TCONFIG_BCMARM),-O3,-Os) -Wall $(EXTRACFLAGS) -I$(TOP)/$(OPENSSLDIR)/staged/usr/include -ffunction-sections -fdata-sections $(if $(TCONFIG_KEYGEN),,-DOPENSSL_NO_ENGINE)" \ - CPPFLAGS="-I$(TOP)/$(OPENSSLDIR)/staged/usr/include" \ + CPPFLAGS="-I$(TOP)/$(OPENSSLDIR)/staged/usr" \ LDFLAGS="-ffunction-sections -fdata-sections -Wl,--gc-sections" \ $(CONFIGURE) --prefix=/usr --with-libevent-dir=$(TOP)/libevent/staged/usr/local \ --with-openssl-dir=$(TOP)/$(OPENSSLDIR)/staged/usr --with-zlib-dir=$(TOP)/zlib/staged/usr \ diff --git a/release/src-rt-6.x.4708/router/libxml2/NEWS b/release/src-rt-6.x.4708/router/libxml2/NEWS index c92eb88255..e7e2db33c6 100644 --- a/release/src-rt-6.x.4708/router/libxml2/NEWS +++ b/release/src-rt-6.x.4708/router/libxml2/NEWS @@ -1,5 +1,17 @@ NEWS file for libxml2 +v2.11.6: Nov 16 2023 + +### Regressions + +- threads: Fix --with-thread-alloc +- xinclude: Fix 'last' pointer in xmlXIncludeCopyNode + +### Bug fixes + +- parser: Fix potential use-after-free in xmlParseCharDataInternal + + v2.11.5: Aug 9 2023 ### Regressions diff --git a/release/src-rt-6.x.4708/router/libxml2/configure.ac b/release/src-rt-6.x.4708/router/libxml2/configure.ac index 718546c967..d40f8ddb14 100644 --- a/release/src-rt-6.x.4708/router/libxml2/configure.ac +++ b/release/src-rt-6.x.4708/router/libxml2/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.63]) m4_define([MAJOR_VERSION], 2) m4_define([MINOR_VERSION], 11) -m4_define([MICRO_VERSION], 5) +m4_define([MICRO_VERSION], 6) AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION]) AC_CONFIG_SRCDIR([entities.c]) diff --git a/release/src-rt-6.x.4708/router/libxml2/parser.c b/release/src-rt-6.x.4708/router/libxml2/parser.c index d3f30b2a76..4feb21a283 100644 --- a/release/src-rt-6.x.4708/router/libxml2/parser.c +++ b/release/src-rt-6.x.4708/router/libxml2/parser.c @@ -4494,6 +4494,8 @@ get_more: line = ctxt->input->line; col = ctxt->input->col; } + if (ctxt->instate == XML_PARSER_EOF) + return; } ctxt->input->cur = in; if (*in == 0xD) { @@ -14322,7 +14324,9 @@ xmlInitParser(void) { __xmlGlobalInitMutexLock(); if (xmlParserInitialized == 0) { #endif -#if defined(_WIN32) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) +#if defined(_WIN32) && \ + !defined(LIBXML_THREAD_ALLOC_ENABLED) && \ + (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) if (xmlFree == free) atexit(xmlCleanupParser); #endif @@ -14392,7 +14396,9 @@ xmlCleanupParser(void) { xmlParserInitialized = 0; } -#if defined(HAVE_ATTRIBUTE_DESTRUCTOR) && !defined(LIBXML_STATIC) && \ +#if defined(HAVE_ATTRIBUTE_DESTRUCTOR) && \ + !defined(LIBXML_THREAD_ALLOC_ENABLED) && \ + !defined(LIBXML_STATIC) && \ !defined(_WIN32) static void ATTRIBUTE_DESTRUCTOR diff --git a/release/src-rt-6.x.4708/router/libxml2/runtest.c b/release/src-rt-6.x.4708/router/libxml2/runtest.c index a29b92ac10..b7fc8e0880 100644 --- a/release/src-rt-6.x.4708/router/libxml2/runtest.c +++ b/release/src-rt-6.x.4708/router/libxml2/runtest.c @@ -4384,6 +4384,10 @@ thread_specific_data(void *private_data) const char *filename = params->filename; int okay = 1; +#ifdef LIBXML_THREAD_ALLOC_ENABLED + xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup); +#endif + if (!strcmp(filename, "test/threads/invalid.xml")) { xmlDoValidityCheckingDefaultValue = 0; xmlGenericErrorContext = stdout; diff --git a/release/src-rt-6.x.4708/router/libxml2/xinclude.c b/release/src-rt-6.x.4708/router/libxml2/xinclude.c index 09c1eef4bd..9e7a2bed81 100644 --- a/release/src-rt-6.x.4708/router/libxml2/xinclude.c +++ b/release/src-rt-6.x.4708/router/libxml2/xinclude.c @@ -733,10 +733,11 @@ xmlXIncludeCopyNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr elem, return(result); while (cur->next == NULL) { + if (insertParent != NULL) + insertParent->last = insertLast; cur = cur->parent; if (cur == elem) return(result); - insertParent->last = insertLast; insertLast = insertParent; insertParent = insertParent->parent; }