mirror of
https://git.yoctoproject.org/poky
synced 2026-03-03 22:09:39 +01:00
Upstream-Status: Backport from [d0c3f01e11,235b15a590] CVE: CVE-2023-39615 (From OE-Core rev: d8a585a8c3712cdce9d9a5241ae7e620bc014ed9) Signed-off-by: Siddharth Doshi <sdoshi@mvista.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
45 lines
1.6 KiB
Diff
45 lines
1.6 KiB
Diff
From 99fc048d7f7292c5ee18e44c400bd73bc63a47ed Mon Sep 17 00:00:00 2001
|
|
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
|
Date: Fri, 14 Aug 2020 14:18:50 +0200
|
|
Subject: [PATCH] Don't use SAX1 if all element handlers are NULL
|
|
|
|
Running xmllint with "--sax --noout" installs a SAX2 handler with all
|
|
callbacks set to NULL. In this case or similar situations, we don't want
|
|
to switch to SAX1 parsing.
|
|
|
|
Note: This patch is needed for "CVE-2023-39615-0002" patch to apply.
|
|
Without this patch the build will fail with undefined sax error.
|
|
|
|
Upstream-Status: Backport from [https://gitlab.gnome.org/GNOME/libxml2/-/commit/99fc048d7f7292c5ee18e44c400bd73bc63a47ed]
|
|
Signed-off-by: Siddharth Doshi <sdoshi@mvista.com>
|
|
---
|
|
parser.c | 10 +++++++---
|
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/parser.c b/parser.c
|
|
index bb677b0..6e09208 100644
|
|
--- a/parser.c
|
|
+++ b/parser.c
|
|
@@ -1098,11 +1098,15 @@ xmlHasFeature(xmlFeature feature)
|
|
*/
|
|
static void
|
|
xmlDetectSAX2(xmlParserCtxtPtr ctxt) {
|
|
+ xmlSAXHandlerPtr sax;
|
|
if (ctxt == NULL) return;
|
|
+ sax = ctxt->sax;
|
|
#ifdef LIBXML_SAX1_ENABLED
|
|
- if ((ctxt->sax) && (ctxt->sax->initialized == XML_SAX2_MAGIC) &&
|
|
- ((ctxt->sax->startElementNs != NULL) ||
|
|
- (ctxt->sax->endElementNs != NULL))) ctxt->sax2 = 1;
|
|
+ if ((sax) && (sax->initialized == XML_SAX2_MAGIC) &&
|
|
+ ((sax->startElementNs != NULL) ||
|
|
+ (sax->endElementNs != NULL) ||
|
|
+ ((sax->startElement == NULL) && (sax->endElement == NULL))))
|
|
+ ctxt->sax2 = 1;
|
|
#else
|
|
ctxt->sax2 = 1;
|
|
#endif /* LIBXML_SAX1_ENABLED */
|
|
--
|
|
2.24.4
|
|
|