diff options
Diffstat (limited to 'meta/recipes-core/libxml/libxml2/fix-CVE-2019-19956.patch')
-rw-r--r-- | meta/recipes-core/libxml/libxml2/fix-CVE-2019-19956.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/recipes-core/libxml/libxml2/fix-CVE-2019-19956.patch b/meta/recipes-core/libxml/libxml2/fix-CVE-2019-19956.patch new file mode 100644 index 0000000000..43c3589d2c --- /dev/null +++ b/meta/recipes-core/libxml/libxml2/fix-CVE-2019-19956.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 3cd2b25ddb04740be2880cfd78d60038452228b1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Zhipeng Xie <xiezhipeng1@huawei.com> | ||
3 | Date: Wed, 7 Aug 2019 17:39:17 +0800 | ||
4 | Subject: [PATCH] Fix memory leak in xmlParseBalancedChunkMemoryRecover | ||
5 | |||
6 | When doc is NULL, namespace created in xmlTreeEnsureXMLDecl | ||
7 | is bind to newDoc->oldNs, in this case, set newDoc->oldNs to | ||
8 | NULL and free newDoc will cause a memory leak. | ||
9 | |||
10 | Found with libFuzzer. | ||
11 | |||
12 | Closes #82. | ||
13 | |||
14 | Upstream-Status: Backport [https://gitlab.gnome.org/GNOME/libxml2/commit/5a02583c7e683896d84878bd90641d8d9b0d0549] | ||
15 | CVE: CVE-2019-19956 | ||
16 | |||
17 | Signed-off-by: Rahul Chauhan <rahulk@mvista.com> | ||
18 | --- | ||
19 | parser.c | 3 ++- | ||
20 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/parser.c b/parser.c | ||
23 | index b7ecd65..491f5c9 100644 | ||
24 | --- a/parser.c | ||
25 | +++ b/parser.c | ||
26 | @@ -13899,7 +13899,8 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax, | ||
27 | xmlFreeParserCtxt(ctxt); | ||
28 | newDoc->intSubset = NULL; | ||
29 | newDoc->extSubset = NULL; | ||
30 | - newDoc->oldNs = NULL; | ||
31 | + if(doc != NULL) | ||
32 | + newDoc->oldNs = NULL; | ||
33 | xmlFreeDoc(newDoc); | ||
34 | |||
35 | return(ret); | ||
36 | -- | ||
37 | 2.7.4 | ||
38 | |||