diff options
Diffstat (limited to 'meta/recipes-support/libxslt/libxslt/CVE-2023-40403-005.patch')
-rw-r--r-- | meta/recipes-support/libxslt/libxslt/CVE-2023-40403-005.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/meta/recipes-support/libxslt/libxslt/CVE-2023-40403-005.patch b/meta/recipes-support/libxslt/libxslt/CVE-2023-40403-005.patch new file mode 100644 index 0000000000..e27034a0ec --- /dev/null +++ b/meta/recipes-support/libxslt/libxslt/CVE-2023-40403-005.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | From 3014af50b22f1be89b5514faea284de7b63fa5dc Mon Sep 17 00:00:00 2001 | ||
2 | From: Nick Wellnhofer <wellnhofer@aevum.de> | ||
3 | Date: Wed, 31 Aug 2022 21:37:44 +0200 | ||
4 | Subject: [PATCH] Clean up attributes in source doc | ||
5 | |||
6 | Also make bit flag constants unsigned to avoid implicit-conversion | ||
7 | warnings. | ||
8 | |||
9 | CVE: CVE-2023-40403 | ||
10 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxslt/-/commit/452fb4ca9b9803448826008b9573987c615912a1] | ||
11 | Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com> | ||
12 | |||
13 | --- | ||
14 | libxslt/transform.c | 10 ++++++++++ | ||
15 | libxslt/xsltutils.h | 6 +++--- | ||
16 | 2 files changed, 13 insertions(+), 3 deletions(-) | ||
17 | |||
18 | diff --git a/libxslt/transform.c b/libxslt/transform.c | ||
19 | index 19d7326..7299eb5 100644 | ||
20 | --- a/libxslt/transform.c | ||
21 | +++ b/libxslt/transform.c | ||
22 | @@ -5764,6 +5764,16 @@ xsltCleanupSourceDoc(xmlDocPtr doc) { | ||
23 | if (psviPtr) | ||
24 | *psviPtr = NULL; | ||
25 | |||
26 | + if (cur->type == XML_ELEMENT_NODE) { | ||
27 | + xmlAttrPtr prop = cur->properties; | ||
28 | + | ||
29 | + while (prop) { | ||
30 | + prop->atype &= ~(XSLT_SOURCE_NODE_MASK << 27); | ||
31 | + prop->psvi = NULL; | ||
32 | + prop = prop->next; | ||
33 | + } | ||
34 | + } | ||
35 | + | ||
36 | if (cur->children != NULL && cur->type != XML_ENTITY_REF_NODE) { | ||
37 | cur = cur->children; | ||
38 | } else { | ||
39 | diff --git a/libxslt/xsltutils.h b/libxslt/xsltutils.h | ||
40 | index 6c14ecf..2af4282 100644 | ||
41 | --- a/libxslt/xsltutils.h | ||
42 | +++ b/libxslt/xsltutils.h | ||
43 | @@ -248,9 +248,9 @@ XSLTPUBFUN xmlXPathCompExprPtr XSLTCALL | ||
44 | int flags); | ||
45 | |||
46 | #ifdef IN_LIBXSLT | ||
47 | -#define XSLT_SOURCE_NODE_MASK 15 | ||
48 | -#define XSLT_SOURCE_NODE_HAS_KEY 1 | ||
49 | -#define XSLT_SOURCE_NODE_HAS_ID 2 | ||
50 | +#define XSLT_SOURCE_NODE_MASK 15u | ||
51 | +#define XSLT_SOURCE_NODE_HAS_KEY 1u | ||
52 | +#define XSLT_SOURCE_NODE_HAS_ID 2u | ||
53 | int | ||
54 | xsltGetSourceNodeFlags(xmlNodePtr node); | ||
55 | int | ||