summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch')
-rw-r--r--meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch98
1 files changed, 98 insertions, 0 deletions
diff --git a/meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch b/meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch
new file mode 100644
index 0000000000..7fc243eec1
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/CVE-2022-23308-fix-regression.patch
@@ -0,0 +1,98 @@
1From 646fe48d1c8a74310c409ddf81fe7df6700052af Mon Sep 17 00:00:00 2001
2From: Nick Wellnhofer <wellnhofer@aevum.de>
3Date: Tue, 22 Feb 2022 11:51:08 +0100
4Subject: [PATCH] Fix --without-valid build
5
6Regressed in commit 652dd12a.
7---
8 valid.c | 58 ++++++++++++++++++++++++++++-----------------------------
9 1 file changed, 29 insertions(+), 29 deletions(-)
10---
11
12From https://github.com/GNOME/libxml2.git
13 commit 646fe48d1c8a74310c409ddf81fe7df6700052af
14
15CVE: CVE-2022-23308
16Upstream-Status: Backport
17
18Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org>
19
20diff --git a/valid.c b/valid.c
21index 8e596f1d..9684683a 100644
22--- a/valid.c
23+++ b/valid.c
24@@ -479,35 +479,6 @@ nodeVPop(xmlValidCtxtPtr ctxt)
25 return (ret);
26 }
27
28-/**
29- * xmlValidNormalizeString:
30- * @str: a string
31- *
32- * Normalize a string in-place.
33- */
34-static void
35-xmlValidNormalizeString(xmlChar *str) {
36- xmlChar *dst;
37- const xmlChar *src;
38-
39- if (str == NULL)
40- return;
41- src = str;
42- dst = str;
43-
44- while (*src == 0x20) src++;
45- while (*src != 0) {
46- if (*src == 0x20) {
47- while (*src == 0x20) src++;
48- if (*src != 0)
49- *dst++ = 0x20;
50- } else {
51- *dst++ = *src++;
52- }
53- }
54- *dst = 0;
55-}
56-
57 #ifdef DEBUG_VALID_ALGO
58 static void
59 xmlValidPrintNode(xmlNodePtr cur) {
60@@ -2636,6 +2607,35 @@ xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table) {
61 (xmlDictOwns(dict, (const xmlChar *)(str)) == 0))) \
62 xmlFree((char *)(str));
63
64+/**
65+ * xmlValidNormalizeString:
66+ * @str: a string
67+ *
68+ * Normalize a string in-place.
69+ */
70+static void
71+xmlValidNormalizeString(xmlChar *str) {
72+ xmlChar *dst;
73+ const xmlChar *src;
74+
75+ if (str == NULL)
76+ return;
77+ src = str;
78+ dst = str;
79+
80+ while (*src == 0x20) src++;
81+ while (*src != 0) {
82+ if (*src == 0x20) {
83+ while (*src == 0x20) src++;
84+ if (*src != 0)
85+ *dst++ = 0x20;
86+ } else {
87+ *dst++ = *src++;
88+ }
89+ }
90+ *dst = 0;
91+}
92+
93 static int
94 xmlIsStreaming(xmlValidCtxtPtr ctxt) {
95 xmlParserCtxtPtr pctxt;
96--
972.35.1
98