From 0d5a4166a437b9db8123d0ce3da5c01e877acfdd Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 20 Nov 2022 10:33:39 -0500 Subject: [PATCH] [LIBXML2] Update to version 2.10.1. CORE-17766 --- media/doc/3rd Party Files.txt | 2 +- sdk/include/reactos/libs/libxml/xmlversion.h | 10 ++++---- sdk/lib/3rdparty/libxml2/HTMLparser.c | 27 +++++--------------- sdk/lib/3rdparty/libxml2/NEWS | 24 +++++++++++++++++ sdk/lib/3rdparty/libxml2/config.h | 2 +- sdk/lib/3rdparty/libxml2/parser.c | 16 ++---------- 6 files changed, 39 insertions(+), 42 deletions(-) diff --git a/media/doc/3rd Party Files.txt b/media/doc/3rd Party Files.txt index 8b7b4e319ac..c7747fee0a7 100644 --- a/media/doc/3rd Party Files.txt +++ b/media/doc/3rd Party Files.txt @@ -239,7 +239,7 @@ URL: https://github.com/win-iconv/win-iconv Title: LibXML Path: sdk/lib/3rdparty/libxml2 -Used Version: 2.10.0 +Used Version: 2.10.1 License: MIT (https://spdx.org/licenses/MIT.htmlf) URL: http://xmlsoft.org, ftp://xmlsoft.org/libxml2/ diff --git a/sdk/include/reactos/libs/libxml/xmlversion.h b/sdk/include/reactos/libs/libxml/xmlversion.h index ad9a2cb82b6..1816bfd7956 100644 --- a/sdk/include/reactos/libs/libxml/xmlversion.h +++ b/sdk/include/reactos/libs/libxml/xmlversion.h @@ -29,28 +29,28 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.10.0" +#define LIBXML_DOTTED_VERSION "2.10.1" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 21000 +#define LIBXML_VERSION 21001 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "21000" +#define LIBXML_VERSION_STRING "21001" /** * LIBXML_VERSION_EXTRA: * * extra version information, used to show a git commit description */ -#define LIBXML_VERSION_EXTRA "-GITv2.9.13-209-gae383bdb7" +#define LIBXML_VERSION_EXTRA "-GITv2.10.0-11-g5d96a5ded" /** * LIBXML_TEST_VERSION: @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(21000); +#define LIBXML_TEST_VERSION xmlCheckVersion(21001); #ifndef VMS #if 0 diff --git a/sdk/lib/3rdparty/libxml2/HTMLparser.c b/sdk/lib/3rdparty/libxml2/HTMLparser.c index abc4e90575c..ba886908e44 100644 --- a/sdk/lib/3rdparty/libxml2/HTMLparser.c +++ b/sdk/lib/3rdparty/libxml2/HTMLparser.c @@ -5056,8 +5056,7 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt) htmlErrMemory(NULL, "htmlInitParserCtxt: out of memory\n"); return(-1); } - else - memset(sax, 0, sizeof(htmlSAXHandler)); + memset(sax, 0, sizeof(htmlSAXHandler)); /* Allocate the Input stack */ ctxt->inputTab = (htmlParserInputPtr *) @@ -5116,11 +5115,9 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt) ctxt->nodeInfoNr = 0; ctxt->nodeInfoMax = 0; - if (sax == NULL) ctxt->sax = (xmlSAXHandlerPtr) &htmlDefaultSAXHandler; - else { - ctxt->sax = sax; - memcpy(sax, &htmlDefaultSAXHandler, sizeof(xmlSAXHandlerV1)); - } + ctxt->sax = sax; + xmlSAX2InitHtmlDefaultSAXHandler(sax); + ctxt->userData = ctxt; ctxt->myDoc = NULL; ctxt->wellFormed = 1; @@ -7116,22 +7113,10 @@ htmlDocPtr htmlCtxtReadDoc(htmlParserCtxtPtr ctxt, const xmlChar * cur, const char *URL, const char *encoding, int options) { - xmlParserInputPtr stream; - if (cur == NULL) return (NULL); - if (ctxt == NULL) - return (NULL); - xmlInitParser(); - - htmlCtxtReset(ctxt); - - stream = xmlNewStringInputStream(ctxt, cur); - if (stream == NULL) { - return (NULL); - } - inputPush(ctxt, stream); - return (htmlDoRead(ctxt, URL, encoding, options, 1)); + return (htmlCtxtReadMemory(ctxt, (const char *) cur, xmlStrlen(cur), URL, + encoding, options)); } /** diff --git a/sdk/lib/3rdparty/libxml2/NEWS b/sdk/lib/3rdparty/libxml2/NEWS index 0a3dd6b03bf..5f562a2f21b 100644 --- a/sdk/lib/3rdparty/libxml2/NEWS +++ b/sdk/lib/3rdparty/libxml2/NEWS @@ -1,5 +1,29 @@ NEWS file for libxml2 +v2.10.1: Aug 25 2022 + +### Regressions + +- Fix xmlCtxtReadDoc with encoding + +### Bug fixes + +- Fix HTML parser with threads and --without-legacy + +### Build system + +- Fix build with Python 3.10 +- cmake: Disable version script on macOS +- Remove Makefile rule to build testapi.c + +### Documentation + +- Switch back to HTML output for API documentation +- Port doc/examples/index.py to Python 3 +- Fix order of exports in libxml2-api.xml +- Remove libxml2-refs.xml + + v2.10.0: Aug 17 2022 ### Security diff --git a/sdk/lib/3rdparty/libxml2/config.h b/sdk/lib/3rdparty/libxml2/config.h index 613a0f4c4e7..a023d17d997 100644 --- a/sdk/lib/3rdparty/libxml2/config.h +++ b/sdk/lib/3rdparty/libxml2/config.h @@ -184,7 +184,7 @@ /* #undef VA_LIST_IS_ARRAY */ /* Version number of package */ -#define VERSION "2.10.0" +#define VERSION "2.10.1" /* Determine what socket length (socklen_t) data type is */ #define XML_SOCKLEN_T int diff --git a/sdk/lib/3rdparty/libxml2/parser.c b/sdk/lib/3rdparty/libxml2/parser.c index e660b0a7d49..93f031be863 100644 --- a/sdk/lib/3rdparty/libxml2/parser.c +++ b/sdk/lib/3rdparty/libxml2/parser.c @@ -15359,22 +15359,10 @@ xmlDocPtr xmlCtxtReadDoc(xmlParserCtxtPtr ctxt, const xmlChar * cur, const char *URL, const char *encoding, int options) { - xmlParserInputPtr stream; - if (cur == NULL) return (NULL); - if (ctxt == NULL) - return (NULL); - xmlInitParser(); - - xmlCtxtReset(ctxt); - - stream = xmlNewStringInputStream(ctxt, cur); - if (stream == NULL) { - return (NULL); - } - inputPush(ctxt, stream); - return (xmlDoRead(ctxt, URL, encoding, options, 1)); + return (xmlCtxtReadMemory(ctxt, (const char *) cur, xmlStrlen(cur), URL, + encoding, options)); } /**