diff options
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.patch | 98 |
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 @@ | |||
1 | From 646fe48d1c8a74310c409ddf81fe7df6700052af Mon Sep 17 00:00:00 2001 | ||
2 | From: Nick Wellnhofer <wellnhofer@aevum.de> | ||
3 | Date: Tue, 22 Feb 2022 11:51:08 +0100 | ||
4 | Subject: [PATCH] Fix --without-valid build | ||
5 | |||
6 | Regressed in commit 652dd12a. | ||
7 | --- | ||
8 | valid.c | 58 ++++++++++++++++++++++++++++----------------------------- | ||
9 | 1 file changed, 29 insertions(+), 29 deletions(-) | ||
10 | --- | ||
11 | |||
12 | From https://github.com/GNOME/libxml2.git | ||
13 | commit 646fe48d1c8a74310c409ddf81fe7df6700052af | ||
14 | |||
15 | CVE: CVE-2022-23308 | ||
16 | Upstream-Status: Backport | ||
17 | |||
18 | Signed-off-by: Ralph Siemsen <ralph.siemsen@linaro.org> | ||
19 | |||
20 | diff --git a/valid.c b/valid.c | ||
21 | index 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 | -- | ||
97 | 2.35.1 | ||
98 | |||