Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
/ jfx22u Public archive

Commit

Permalink
8332539: Update libxml2 to 2.12.7
Browse files Browse the repository at this point in the history
Backport-of: dedcf1d236b5429dcf3c42f5fd1095b28d5da063
  • Loading branch information
Hima Bindu Meda committed May 31, 2024
1 parent 8cdc502 commit f0c3e88
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 41 deletions.
2 changes: 1 addition & 1 deletion modules/javafx.web/src/main/legal/libxml2.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## xmlsoft.org: libxml2 v2.12.6
## xmlsoft.org: libxml2 v2.12.7

### libxml2 License
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
#define PACKAGE_NAME "libxml2"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libxml2 2.12.6"
#define PACKAGE_STRING "libxml2 2.12.7"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libxml2"
Expand All @@ -145,7 +145,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "2.12.6"
#define PACKAGE_VERSION "2.12.7"

/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
Expand All @@ -159,7 +159,7 @@
#define VA_LIST_IS_ARRAY 1

/* Version number of package */
#define VERSION "2.12.6"
#define VERSION "2.12.7"

/* Determine what socket length (socklen_t) data type is */
#define XML_SOCKLEN_T socklen_t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ XMLPUBFUN void xmlCheckVersion(int version);
*
* the version string like "1.2.3"
*/
#define LIBXML_DOTTED_VERSION "2.12.6"
#define LIBXML_DOTTED_VERSION "2.12.7"

/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXML_VERSION 21206
#define LIBXML_VERSION 21207

/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXML_VERSION_STRING "21206"
#define LIBXML_VERSION_STRING "21207"

/**
* LIBXML_VERSION_EXTRA:
Expand All @@ -58,7 +58,7 @@ XMLPUBFUN void 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(21206);
#define LIBXML_TEST_VERSION xmlCheckVersion(21207);

#ifndef VMS
#if 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
#define PACKAGE_NAME "libxml2"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "libxml2 2.12.6"
#define PACKAGE_STRING "libxml2 2.12.7"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libxml2"
Expand All @@ -145,7 +145,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "2.12.6"
#define PACKAGE_VERSION "2.12.7"

/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
Expand All @@ -159,7 +159,7 @@
#define VA_LIST_IS_ARRAY 1

/* Version number of package */
#define VERSION "2.12.6"
#define VERSION "2.12.7"

/* Determine what socket length (socklen_t) data type is */
#define XML_SOCKLEN_T socklen_t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ XMLPUBFUN void xmlCheckVersion(int version);
*
* the version string like "1.2.3"
*/
#define LIBXML_DOTTED_VERSION "2.12.6"
#define LIBXML_DOTTED_VERSION "2.12.7"

/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXML_VERSION 21206
#define LIBXML_VERSION 21207

/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXML_VERSION_STRING "21206"
#define LIBXML_VERSION_STRING "21207"

/**
* LIBXML_VERSION_EXTRA:
Expand All @@ -58,7 +58,7 @@ XMLPUBFUN void 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(21206);
#define LIBXML_TEST_VERSION xmlCheckVersion(21207);

#ifndef VMS
#if 0
Expand Down Expand Up @@ -248,9 +248,9 @@ XMLPUBFUN void xmlCheckVersion(int version);
#endif

/**
* LIBXML_XINCLUDE_ENABLED:
* LIBXML_XPTR_LOCS_ENABLED:
*
* Whether XInclude is configured in
* Whether support for XPointer locations is configured in
*/
#if 0
#define LIBXML_XPTR_LOCS_ENABLED
Expand Down Expand Up @@ -313,7 +313,7 @@ XMLPUBFUN void xmlCheckVersion(int version);
/**
* LIBXML_DEBUG_RUNTIME:
*
* Whether the runtime debugging is configured in
* Removed
*/
#if 0
#define LIBXML_DEBUG_RUNTIME
Expand Down Expand Up @@ -409,12 +409,7 @@ XMLPUBFUN void xmlCheckVersion(int version);
#endif

#ifdef __GNUC__

/**
* ATTRIBUTE_UNUSED:
*
* Macro used to signal to GCC unused function parameters
*/
/** DOC_DISABLE */

#ifndef ATTRIBUTE_UNUSED
# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
NEWS file for libxml2

v2.12.7: May 13 2024

### Security

- [CVE-2024-34459] Fix buffer overread with `xmllint --htmlout`

### Regressions

- xmllint: Fix --pedantic option
- save: Handle invalid parent pointers in xhtmlNodeDumpOutput


v2.12.6: Mar 15 2024

### Regressions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AC_PREREQ([2.63])

m4_define([MAJOR_VERSION], 2)
m4_define([MINOR_VERSION], 12)
m4_define([MICRO_VERSION], 6)
m4_define([MICRO_VERSION], 7)

AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
AC_CONFIG_SRCDIR([entities.c])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1391,13 +1391,14 @@ xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
static void
xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
int format = ctxt->format, addmeta;
xmlNodePtr tmp, root, unformattedNode = NULL;
xmlNodePtr tmp, root, unformattedNode = NULL, parent;
xmlChar *start, *end;
xmlOutputBufferPtr buf = ctxt->buf;

if (cur == NULL) return;

root = cur;
parent = cur->parent;
while (1) {
switch (cur->type) {
case XML_DOCUMENT_NODE:
Expand All @@ -1414,7 +1415,9 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
break;

case XML_DOCUMENT_FRAG_NODE:
if (cur->children) {
/* Always validate cur->parent when descending. */
if ((cur->parent == parent) && (cur->children != NULL)) {
parent = cur;
cur = cur->children;
continue;
}
Expand All @@ -1441,6 +1444,16 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
ctxt->indent_nr : ctxt->level),
ctxt->indent);

/*
* Some users like lxml are known to pass nodes with a corrupted
* tree structure. Fall back to a recursive call to handle this
* case.
*/
if ((cur->parent != parent) && (cur->children != NULL)) {
xhtmlNodeDumpOutput(ctxt, cur);
break;
}

xmlOutputBufferWrite(buf, 1, "<");
if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
Expand All @@ -1461,10 +1474,10 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
if (cur->properties != NULL)
xhtmlAttrListDumpOutput(ctxt, cur->properties);

if ((cur->parent != NULL) &&
(cur->parent->parent == (xmlNodePtr) cur->doc) &&
if ((parent != NULL) &&
(parent->parent == (xmlNodePtr) cur->doc) &&
xmlStrEqual(cur->name, BAD_CAST"head") &&
xmlStrEqual(cur->parent->name, BAD_CAST"html")) {
xmlStrEqual(parent->name, BAD_CAST"html")) {

tmp = cur->children;
while (tmp != NULL) {
Expand Down Expand Up @@ -1570,6 +1583,7 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {

if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
if (ctxt->level >= 0) ctxt->level++;
parent = cur;
cur = cur->children;
continue;
}
Expand Down Expand Up @@ -1664,13 +1678,9 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
break;
}

/*
* The parent should never be NULL here but we want to handle
* corrupted documents gracefully.
*/
if (cur->parent == NULL)
return;
cur = cur->parent;
cur = parent;
/* cur->parent was validated when descending. */
parent = cur->parent;

if (cur->type == XML_ELEMENT_NODE) {
if (ctxt->level > 0) ctxt->level--;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ XMLPUBFUN void xmlCheckVersion(int version);
*
* the version string like "1.2.3"
*/
#define LIBXML_DOTTED_VERSION "2.12.6"
#define LIBXML_DOTTED_VERSION "2.12.7"

/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXML_VERSION 21206
#define LIBXML_VERSION 21207

/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXML_VERSION_STRING "21206"
#define LIBXML_VERSION_STRING "21207"

/**
* LIBXML_VERSION_EXTRA:
Expand All @@ -58,7 +58,7 @@ XMLPUBFUN void 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(21206);
#define LIBXML_TEST_VERSION xmlCheckVersion(21207);

#ifndef VMS
#if 0
Expand Down

1 comment on commit f0c3e88

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.