Skip to content

Commit

Permalink
Roll libxml from 76d6b0d7 to f67dc618
Browse files Browse the repository at this point in the history
2022-12-17 wellnhofer@aevum.de xmlreader: Try to fix regression when reading from memory
2022-12-12 wellnhofer@aevum.de uri: Fix handling of port numbers
2022-12-13 wellnhofer@aevum.de Revert "uri: Allow port without host"
2022-12-08 wellnhofer@aevum.de xmlmemory.c: Remove xmlMemContentShow
2022-12-08 wellnhofer@aevum.de testapi.c: Initialize catalog early
2022-12-08 wellnhofer@aevum.de gentest.py: Fix memory leak in API tests
2022-12-08 wellnhofer@aevum.de doc/libxml2-api.xml: Regenerate
2022-12-08 wellnhofer@aevum.de encoding.c: Fix for documentation generator
2022-12-08 lukastyrychtr@gmail.com catalog.c: Silence a cast warning on VS 2022
2022-12-08 wellnhofer@aevum.de libxml.h: Add comments and indentation
2022-12-08 wellnhofer@aevum.de libxml.h: Remove dubious definition of LIBXML_STATIC
2022-12-08 wellnhofer@aevum.de libxml.h: Don't include stdio.h
2022-12-08 wellnhofer@aevum.de libxml.h: Remove ancient LynxOS setup
2022-12-08 wellnhofer@aevum.de xmlexports.h: Disable docs for internal macro XMLPUBLIC
2022-12-08 wellnhofer@aevum.de xmlexports.h: Remove LIBXML_FASTCALL optimization
2022-12-08 wellnhofer@aevum.de Remove XMLCALL and XMLCDECL macros from public headers
2022-12-08 wellnhofer@aevum.de Remove XMLDECL macro from .c files
2022-12-08 wellnhofer@aevum.de Update README.md
2022-12-08 wellnhofer@aevum.de tests: Enable "runsuite" test
2022-12-06 ross.burton@arm.com Use python3 not python
2022-12-07 ross.burton@arm.com xstc/fixup-tests.py: port to Python 3
2022-12-07 ross.burton@arm.com xstc/fixup-tests.py: unify whitespace
2022-12-05 ross.burton@arm.com libxml.m4: deprecate AM_PATH_XML2, wrap PKG_CHECK_MODULES instead
2022-12-06 ross.burton@arm.com python/tests/reader2: use absolute paths everywhere
2022-12-06 ross.burton@arm.com python/tests/reader2: always exit(1) if a test fails
2022-12-06 ross.burton@arm.com testModule: exit if the module can't be opened
2022-12-06 ross.burton@arm.com CI: disable modules in gcc:static build
2022-12-06 ross.burton@arm.com CI: fix CI on MinGW builds
2022-12-04 wellnhofer@aevum.de error: Make sure that error messages are valid UTF-8
2022-12-01 Alexander.Richardson@cl.cam.ac.uk Remove hacky heuristic from b2dc5675e94aa6b5557ba63f7d66b0f08dd17e4d
2022-12-01 Alexander.Richardson@cl.cam.ac.uk Avoid creating an out-of-bounds pointer by rewriting a check
2022-12-01 Alexander.Richardson@cl.cam.ac.uk Correctly relocate internal pointers after realloc()
2022-11-30 wellnhofer@aevum.de html: Improve parsing of nested lists
2022-11-27 wellnhofer@aevum.de Hide internal functions
2022-11-25 wellnhofer@aevum.de python: Fix memory leak checks
2022-11-25 wellnhofer@aevum.de memory: Don't use locks in xmlMemUsed
2022-11-25 wellnhofer@aevum.de html: Fix htmlInitAutoClose documentation
2022-11-25 wellnhofer@aevum.de xpath: Make init function private
2022-11-25 wellnhofer@aevum.de encoding: Make init function private
2022-11-25 wellnhofer@aevum.de encoding: Remove unused variable xmlDefaultCharEncodingHandler
2022-11-25 wellnhofer@aevum.de tests: Check that xmlInitParser doesn't allocate memory
2022-11-25 wellnhofer@aevum.de parser: Register atexit handler in locked section
2022-10-24 wellnhofer@aevum.de threads: Use __libc_single_threaded if available
2022-11-24 wellnhofer@aevum.de threads: Deprecate some internal functions
2022-11-24 wellnhofer@aevum.de threads: Allocate mutexes statically
2022-11-25 wellnhofer@aevum.de memory: Remove xmlDictInitialized
2022-11-25 wellnhofer@aevum.de dict: Make init/cleanup functions private
2022-11-25 wellnhofer@aevum.de memory: Remove xmlMemInitialized
2022-11-25 wellnhofer@aevum.de threads: Rework initialization
2022-11-24 wellnhofer@aevum.de parser: Make some module init/cleanup functions private
2022-11-24 wellnhofer@aevum.de parser: Don't call *DefaultSAXHandlerInit from xmlInitParser
2022-11-24 wellnhofer@aevum.de encoding: Allocate default handlers statically
2022-11-23 sam@gentoo.org libxml.m4: fix -Wstrict-prototypes
2022-11-22 fanchunwei@src.gnome.org Visual Studio builds: Allow silencing deprecation warnings
2022-11-18 fanc999@yahoo.com.tw Visual Studio: Define XML_DEPRECATED
2022-11-22 wellnhofer@aevum.de parser: Fix push parser with unterminated CDATA sections
2022-11-22 wellnhofer@aevum.de tests: Fix use-after-free in Python tests
2022-11-22 wellnhofer@aevum.de Fix .editorconfig
2022-11-22 wellnhofer@aevum.de tests: Remove unneeded #includes
2022-11-22 wellnhofer@aevum.de xmllint: Include <io.h> on Windows
2022-11-22 wellnhofer@aevum.de gitlab-ci: Make Test-Msvc exit if ctest fails
2022-11-22 wellnhofer@aevum.de gitlab-ci: Treat compiler warnings as errors on MSVC
2022-11-22 wellnhofer@aevum.de warnings: Work around MSVC bug
2022-11-22 fanchunwei@src.gnome.org sources: Silence C4013 warnings on Visual Studio
2022-11-21 wellnhofer@aevum.de parser: Remove dangerous check in xmlParseCharData
2022-11-21 wellnhofer@aevum.de parser: Restore parser state in xmlParseCDSect
2022-11-21 wellnhofer@aevum.de parser: Fix progress check when parsing character data
2022-11-21 wellnhofer@aevum.de Fix .editorconfig
2022-11-21 wellnhofer@aevum.de parser: Check terminate flag when push parsing CDATA sections
2022-11-21 wellnhofer@aevum.de Revert "parser: Add overflow checks to xmlParseLookup functions"
2022-11-21 wellnhofer@aevum.de parser: Add overflow checks to xmlParseLookup functions
2022-11-18 fanc999@yahoo.com.tw python/setup.py.in: Improve Windows import patching
2022-11-20 wellnhofer@aevum.de Add .editorconfig
2022-11-20 wellnhofer@aevum.de parser: Merge misc, prolog and epilog cases in push parser
2022-11-20 wellnhofer@aevum.de test: Add test for push parser boundaries
2022-11-20 wellnhofer@aevum.de parser: Fix 'consumed' accounting when switching encodings
2022-11-20 wellnhofer@aevum.de html: Fix check for end of comment in push parser
2022-11-20 wellnhofer@aevum.de parser: Fix push parser with 1-3 byte initial chunk
2022-11-15 wellnhofer@aevum.de parser: Rewrite push parser boundary checks
2022-11-14 wellnhofer@aevum.de buf: Deprecate static/immutable buffers
2022-11-14 wellnhofer@aevum.de reader: Switch to xmlParserInputBufferCreateMem
2022-11-14 wellnhofer@aevum.de uri: Allow port without host

Bug: 934413
Change-Id: I35f9dd87cd2f2991d1e26ad9f4bcd9af689bf67d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4115789
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Stephen Chenney <schenney@chromium.org>
Auto-Submit: Joey Arhar <jarhar@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1084958}
  • Loading branch information
josepharhar authored and Chromium LUCI CQ committed Dec 19, 2022
1 parent 14ecf23 commit 55af768
Show file tree
Hide file tree
Showing 117 changed files with 3,506 additions and 3,650 deletions.
2 changes: 1 addition & 1 deletion third_party/libxml/README.chromium
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: libxml
URL: http://xmlsoft.org
Version: 76d6b0d768d4e60a2d2844d55def120257ab6c6e
Version: f67dc6189fce50aec9c1446cbe8c55268564485b
CPEPrefix: cpe:/a:xmlsoft:libxml2:2.9.13
License: MIT
License File: src/Copyright
Expand Down
6 changes: 3 additions & 3 deletions third_party/libxml/chromium/undo-sax-deprecation.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
diff --git a/include/libxml/parser.h b/include/libxml/parser.h
index f96148b5..1587b9d0 100644
index d104b874..6dc4ca9b 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -897,7 +897,9 @@ XMLPUBFUN xmlDocPtr XMLCALL
@@ -899,7 +899,9 @@ XMLPUBFUN xmlDocPtr
xmlSAXParseDoc (xmlSAXHandlerPtr sax,
const xmlChar *cur,
int recovery);
-XML_DEPRECATED
+// TODO(https://github.com/google/maldoca/issues/87): Re-Deprecate this when
+// maldoca stops using xmlSAXParseMemory.
+//XML_DEPRECATED
XMLPUBFUN xmlDocPtr XMLCALL
XMLPUBFUN xmlDocPtr
xmlSAXParseMemory (xmlSAXHandlerPtr sax,
const char *buffer,
29 changes: 22 additions & 7 deletions third_party/libxml/linux/include/libxml/xmlversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C" {
* your library and includes mismatch
*/
#ifndef LIBXML2_COMPILING_MSCCDEF
XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
XMLPUBFUN void xmlCheckVersion(int version);
#endif /* LIBXML2_COMPILING_MSCCDEF */

/**
Expand Down Expand Up @@ -440,10 +440,10 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif

#ifndef XML_DEPRECATED
# ifdef IN_LIBXML
# if defined (IN_LIBXML) || (__GNUC__ * 100 + __GNUC_MINOR__ < 301)
# define XML_DEPRECATED
# else
/* Available since at least GCC 3.1 */
# else
# define XML_DEPRECATED __attribute__((deprecated))
# endif
#endif
Expand Down Expand Up @@ -487,20 +487,35 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* is deprecated.
*/
#ifndef XML_DEPRECATED
#define XML_DEPRECATED
# if defined (IN_LIBXML) || !defined (_MSC_VER)
# define XML_DEPRECATED
/* Available since Visual Studio 2005 */
# elif defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_DEPRECATED __declspec(deprecated)
# endif
#endif
/**
* LIBXML_IGNORE_FPTR_CAST_WARNINGS:
*
* Macro used to ignore pointer cast warnings that can't be worked around.
*/
#define XML_IGNORE_FPTR_CAST_WARNINGS
#if defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_IGNORE_FPTR_CAST_WARNINGS __pragma(warning(push))
#else
# define XML_IGNORE_FPTR_CAST_WARNINGS
#endif
/**
* LIBXML_POP_WARNINGS:
* XML_POP_WARNINGS:
*
* Macro used to restore warnings state.
*/
#define XML_POP_WARNINGS
#ifndef XML_POP_WARNINGS
# if defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_POP_WARNINGS __pragma(warning(pop))
# else
# define XML_POP_WARNINGS
# endif
#endif
#endif /* __GNUC__ */

#ifdef __cplusplus
Expand Down
29 changes: 22 additions & 7 deletions third_party/libxml/mac/include/libxml/xmlversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C" {
* your library and includes mismatch
*/
#ifndef LIBXML2_COMPILING_MSCCDEF
XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
XMLPUBFUN void xmlCheckVersion(int version);
#endif /* LIBXML2_COMPILING_MSCCDEF */

/**
Expand Down Expand Up @@ -440,10 +440,10 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif

#ifndef XML_DEPRECATED
# ifdef IN_LIBXML
# if defined (IN_LIBXML) || (__GNUC__ * 100 + __GNUC_MINOR__ < 301)
# define XML_DEPRECATED
# else
/* Available since at least GCC 3.1 */
# else
# define XML_DEPRECATED __attribute__((deprecated))
# endif
#endif
Expand Down Expand Up @@ -487,20 +487,35 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* is deprecated.
*/
#ifndef XML_DEPRECATED
#define XML_DEPRECATED
# if defined (IN_LIBXML) || !defined (_MSC_VER)
# define XML_DEPRECATED
/* Available since Visual Studio 2005 */
# elif defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_DEPRECATED __declspec(deprecated)
# endif
#endif
/**
* LIBXML_IGNORE_FPTR_CAST_WARNINGS:
*
* Macro used to ignore pointer cast warnings that can't be worked around.
*/
#define XML_IGNORE_FPTR_CAST_WARNINGS
#if defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_IGNORE_FPTR_CAST_WARNINGS __pragma(warning(push))
#else
# define XML_IGNORE_FPTR_CAST_WARNINGS
#endif
/**
* LIBXML_POP_WARNINGS:
* XML_POP_WARNINGS:
*
* Macro used to restore warnings state.
*/
#define XML_POP_WARNINGS
#ifndef XML_POP_WARNINGS
# if defined (_MSC_VER) && (_MSC_VER >= 1400)
# define XML_POP_WARNINGS __pragma(warning(pop))
# else
# define XML_POP_WARNINGS
# endif
#endif
#endif /* __GNUC__ */

#ifdef __cplusplus
Expand Down
1 change: 1 addition & 0 deletions third_party/libxml/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ if(LIBXML2_WITH_TESTS)
endforeach()
endif()
add_test(NAME runtest COMMAND runtest --out ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_test(NAME runsuite COMMAND runsuite WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if(EXISTS ${LIBXML2_XMLCONF_WORKING_DIR}/xmlconf/xmlconf.xml)
add_test(NAME runxmlconf COMMAND runxmlconf WORKING_DIRECTORY ${LIBXML2_XMLCONF_WORKING_DIR})
endif()
Expand Down
97 changes: 33 additions & 64 deletions third_party/libxml/src/HTMLparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,6 @@ static const htmlStartCloseEntry htmlStartClose[] = {
{ "menu", "form" },
{ "menu", "ul" },
{ "ol", "form" },
{ "ol", "ul" },
{ "option", "optgroup" },
{ "option", "option" },
{ "p", "address" },
Expand Down Expand Up @@ -1306,7 +1305,6 @@ static const htmlStartCloseEntry htmlStartClose[] = {
{ "ul", "address" },
{ "ul", "form" },
{ "ul", "menu" },
{ "ul", "ol" },
{ "ul", "pre" },
{ "xmp", "dd" },
{ "xmp", "dl" },
Expand Down Expand Up @@ -1394,10 +1392,7 @@ static const elementPriority htmlEndPriority[] = {
/**
* htmlInitAutoClose:
*
* DEPRECATED: This function will be made private. Call xmlInitParser to
* initialize the library.
*
* This is a no-op now.
* DEPRECATED: This is a no-op.
*/
void
htmlInitAutoClose(void) {
Expand Down Expand Up @@ -2319,7 +2314,7 @@ htmlEncodeEntities(unsigned char* out, int *outlen,
else
cp = ent->name;
len = strlen(cp);
if (out + 2 + len > outend)
if (outend - out < len + 2)
break;
*out++ = '&';
memcpy(out, cp, len);
Expand Down Expand Up @@ -5334,30 +5329,17 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
int base, len;
htmlParserInputPtr in;
const xmlChar *buf;
int invalue = 0;
char valdellim = 0x0;
int quote;

in = ctxt->input;
if (in == NULL)
return (-1);

base = in->cur - in->base;
if (base < 0)
return (-1);

if (ctxt->checkIndex > base) {
base = ctxt->checkIndex;
/* Abuse hasPErefs member to restore current state. */
invalue = ctxt->hasPErefs & 1 ? 1 : 0;
}
base = ctxt->checkIndex;
quote = ctxt->endCheckState;

if (in->buf == NULL) {
buf = in->base;
len = in->length;
} else {
buf = xmlBufContent(in->buf->buffer);
len = xmlBufUse(in->buf->buffer);
}
buf = in->cur;
len = in->end - in->cur;

/* take into account the sequence length */
if (third)
Expand All @@ -5366,18 +5348,13 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
len--;
for (; base < len; base++) {
if (ignoreattrval) {
if (quote) {
if (buf[base] == quote)
quote = 0;
continue;
}
if (buf[base] == '"' || buf[base] == '\'') {
if (invalue) {
if (buf[base] == valdellim) {
invalue = 0;
continue;
}
} else {
valdellim = buf[base];
invalue = 1;
continue;
}
} else if (invalue) {
quote = buf[base];
continue;
}
}
Expand All @@ -5390,29 +5367,12 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
continue;
}
ctxt->checkIndex = 0;
#ifdef DEBUG_PUSH
if (next == 0)
xmlGenericError(xmlGenericErrorContext,
"HPP: lookup '%c' found at %d\n",
first, base);
else if (third == 0)
xmlGenericError(xmlGenericErrorContext,
"HPP: lookup '%c%c' found at %d\n",
first, next, base);
else
xmlGenericError(xmlGenericErrorContext,
"HPP: lookup '%c%c%c' found at %d\n",
first, next, third, base);
#endif
return (base - (in->cur - in->base));
ctxt->endCheckState = 0;
return (base);
}
}
ctxt->checkIndex = base;
/* Abuse hasPErefs member to track current state. */
if (invalue)
ctxt->hasPErefs |= 1;
else
ctxt->hasPErefs &= ~1;
ctxt->endCheckState = quote;
#ifdef DEBUG_PUSH
if (next == 0)
xmlGenericError(xmlGenericErrorContext,
Expand Down Expand Up @@ -5446,16 +5406,23 @@ static int
htmlParseLookupCommentEnd(htmlParserCtxtPtr ctxt)
{
int mark = 0;
int cur = CUR_PTR - BASE_PTR;
int offset;

while (mark >= 0) {
while (1) {
mark = htmlParseLookupSequence(ctxt, '-', '-', 0, 0);
if ((mark < 0) ||
(NXT(mark+2) == '>') ||
if (mark < 0)
break;
if ((NXT(mark+2) == '>') ||
((NXT(mark+2) == '!') && (NXT(mark+3) == '>'))) {
return mark;
ctxt->checkIndex = 0;
break;
}
ctxt->checkIndex = cur + mark + 1;
offset = (NXT(mark+2) == '!') ? 3 : 2;
if (mark + offset >= ctxt->input->end - ctxt->input->cur) {
ctxt->checkIndex = mark;
return(-1);
}
ctxt->checkIndex = mark + 1;
}
return mark;
}
Expand Down Expand Up @@ -5990,6 +5957,8 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
break;
}
} else if ((cur == '<') && (next == '!')) {
if (avail < 4)
goto done;
/*
* Sometimes DOCTYPE arrives in the middle of the document
*/
Expand Down Expand Up @@ -6030,8 +5999,6 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
#endif
htmlParsePI(ctxt);
ctxt->instate = XML_PARSER_CONTENT;
} else if ((cur == '<') && (next == '!') && (avail < 4)) {
goto done;
} else if ((cur == '<') && (next == '/')) {
ctxt->instate = XML_PARSER_END_TAG;
ctxt->checkIndex = 0;
Expand Down Expand Up @@ -6802,10 +6769,12 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt)
ctxt->disableSAX = 0;
ctxt->valid = 1;
ctxt->vctxt.userData = ctxt;
ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT;
ctxt->vctxt.error = xmlParserValidityError;
ctxt->vctxt.warning = xmlParserValidityWarning;
ctxt->record_info = 0;
ctxt->checkIndex = 0;
ctxt->endCheckState = 0;
ctxt->inSubset = 0;
ctxt->errNo = XML_ERR_OK;
ctxt->depth = 0;
Expand Down
3 changes: 2 additions & 1 deletion third_party/libxml/src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,13 @@ check-local:
[ -d result ] || $(LN_S) $(srcdir)/result .
$(CHECKER) ./runtest$(EXEEXT)
$(CHECKER) ./testrecurse$(EXEEXT)
ASAN_OPTIONS="$$ASAN_OPTIONS:detect_leaks=0" $(CHECKER) ./testapi$(EXEEXT)
$(CHECKER) ./testapi$(EXEEXT)
$(CHECKER) ./testchar$(EXEEXT)
$(CHECKER) ./testdict$(EXEEXT)
$(CHECKER) ./testModule$(EXEEXT)
$(CHECKER) ./testThreads$(EXEEXT)
$(CHECKER) ./runxmlconf$(EXEEXT)
$(CHECKER) ./runsuite$(EXEEXT)

# Compatibility name of the check target
runtests: check
Expand Down
14 changes: 8 additions & 6 deletions third_party/libxml/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
libxml2 is an XML toolkit implemented in C, originally developed for
the GNOME Project.

Full documentation is available at
<https://gitlab.gnome.org/GNOME/libxml2/-/wikis>.
Official releases can be downloaded from
<https://download.gnome.org/sources/libxml2/>

The git repository is hosted on GNOME's GitLab server:
<https://gitlab.gnome.org/GNOME/libxml2>

Bugs should be reported at
<https://gitlab.gnome.org/GNOME/libxml2/-/issues>.
<https://gitlab.gnome.org/GNOME/libxml2/-/issues>

A mailing list xml@gnome.org is available. You can subscribe at
<https://mail.gnome.org/mailman/listinfo/xml>. The list archive is at
<https://mail.gnome.org/archives/xml/>.
Documentation is available at
<https://gitlab.gnome.org/GNOME/libxml2/-/wikis>

## License

Expand Down

0 comments on commit 55af768

Please sign in to comment.