libxml2: patch CVE-2026-0992

Pick patch which closed [1].
Adapt for missing xmlCatalogPrintDebug per [2].

[1] https://gitlab.gnome.org/GNOME/libxml2/-/issues/1019
[2] 728869809e

(From OE-Core rev: efef4d450500eb3a43b9f1f399ca84f9ca837d8b)

Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Paul Barker <paul@pbarker.dev>
This commit is contained in:
Peter Marko
2026-01-25 19:35:19 +01:00
committed by Paul Barker
parent bd6c85cfa6
commit 9998d74d24
2 changed files with 50 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
From f75abfcaa419a740a3191e56c60400f3ff18988d Mon Sep 17 00:00:00 2001
From: Daniel Garcia Moreno <daniel.garcia@suse.com>
Date: Fri, 19 Dec 2025 11:02:18 +0100
Subject: [PATCH] catalog: Ignore repeated nextCatalog entries
This patch makes the catalog parsing to ignore repeated entries of
nextCatalog with the same value.
Fix https://gitlab.gnome.org/GNOME/libxml2/-/issues/1019
CVE: CVE-2026-0989
Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/-/commit/f75abfcaa419a740a3191e56c60400f3ff18988d]
Signed-off-by: Peter Marko <peter.marko@siemens.com>
---
catalog.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/catalog.c b/catalog.c
index 46b877e6..fa6d77ca 100644
--- a/catalog.c
+++ b/catalog.c
@@ -1279,9 +1279,27 @@ xmlParseXMLCatalogNode(xmlNodePtr cur, xmlCatalogPrefer prefer,
BAD_CAST "delegateURI", BAD_CAST "uriStartString",
BAD_CAST "catalog", prefer, cgroup);
} else if (xmlStrEqual(cur->name, BAD_CAST "nextCatalog")) {
+ xmlCatalogEntryPtr prev = parent->children;
+
entry = xmlParseXMLCatalogOneNode(cur, XML_CATA_NEXT_CATALOG,
BAD_CAST "nextCatalog", NULL,
BAD_CAST "catalog", prefer, cgroup);
+ /* Avoid duplication of nextCatalog */
+ while (prev != NULL) {
+ if ((prev->type == XML_CATA_NEXT_CATALOG) &&
+ (xmlStrEqual (prev->URL, entry->URL)) &&
+ (xmlStrEqual (prev->value, entry->value)) &&
+ (prev->prefer == entry->prefer) &&
+ (prev->group == entry->group)) {
+ if (xmlDebugCatalogs)
+ fprintf(stderr,
+ "Ignoring repeated nextCatalog %s\n", entry->URL);
+ xmlFreeCatalogEntry(entry, NULL);
+ entry = NULL;
+ break;
+ }
+ prev = prev->next;
+ }
}
if (entry != NULL) {
if (parent != NULL) {

View File

@@ -45,6 +45,7 @@ SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar;subdir=${BP};name=testt
file://CVE-2025-9714.patch \
file://CVE-2025-7425.patch \
file://CVE-2026-0990.patch \
file://CVE-2026-0992.patch \
"
SRC_URI[archive.sha256sum] = "60d74a257d1ccec0475e749cba2f21559e48139efba6ff28224357c7c798dfee"