forked from pool/libxml2
- Fix invalid xmlns references since the fix for CVE-2019-19956 [bsc#1172021]
- Revert upstream commit 5a02583c7e683896d84878bd90641d8d9b0d0549
* Add patch libxml2-CVE-2019-19956.patch
- Security fix: [bsc#1161517, CVE-2020-7595]
* xmlStringLenDecodeEntities in parser.c has an infinite loop in
a certain end-of-file situation
- Add libxml2-CVE-2020-7595.patch
OBS-URL: https://build.opensuse.org/request/show/809632
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libxml2?expand=0&rev=147
31 lines
900 B
Diff
31 lines
900 B
Diff
From 5a02583c7e683896d84878bd90641d8d9b0d0549 Mon Sep 17 00:00:00 2001
|
|
From: Zhipeng Xie <xiezhipeng1@huawei.com>
|
|
Date: Wed, 7 Aug 2019 17:39:17 +0800
|
|
Subject: [PATCH] Fix memory leak in xmlParseBalancedChunkMemoryRecover
|
|
|
|
When doc is NULL, namespace created in xmlTreeEnsureXMLDecl
|
|
is bind to newDoc->oldNs, in this case, set newDoc->oldNs to
|
|
NULL and free newDoc will cause a memory leak.
|
|
|
|
Found with libFuzzer.
|
|
|
|
Closes #82.
|
|
---
|
|
parser.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/parser.c b/parser.c
|
|
index 1ce1ccf14..26d9f4e3b 100644
|
|
--- a/parser.c
|
|
+++ b/parser.c
|
|
@@ -13894,7 +13894,8 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
|
|
xmlFreeParserCtxt(ctxt);
|
|
newDoc->intSubset = NULL;
|
|
newDoc->extSubset = NULL;
|
|
- newDoc->oldNs = NULL;
|
|
+ if(doc != NULL)
|
|
+ newDoc->oldNs = NULL;
|
|
xmlFreeDoc(newDoc);
|
|
|
|
return(ret);
|