Blame SOURCES/libxml2-2.9.7-CVE-2019-20388.patch

a2f31b
From 7ffcd44d7e6c46704f8af0321d9314cd26e0e18a Mon Sep 17 00:00:00 2001
a2f31b
From: Zhipeng Xie <xiezhipeng1@huawei.com>
a2f31b
Date: Tue, 20 Aug 2019 16:33:06 +0800
a2f31b
Subject: [PATCH] Fix memory leak in xmlSchemaValidateStream
a2f31b
a2f31b
When ctxt->schema is NULL, xmlSchemaSAXPlug->xmlSchemaPreRun
a2f31b
alloc a new schema for ctxt->schema and set vctxt->xsiAssemble
a2f31b
to 1. Then xmlSchemaVStart->xmlSchemaPreRun initialize
a2f31b
vctxt->xsiAssemble to 0 again which cause the alloced schema
a2f31b
can not be freed anymore.
a2f31b
a2f31b
Found with libFuzzer.
a2f31b
a2f31b
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
a2f31b
---
a2f31b
 xmlschemas.c | 1 -
a2f31b
 1 file changed, 1 deletion(-)
a2f31b
a2f31b
diff --git a/xmlschemas.c b/xmlschemas.c
a2f31b
index 301c8449..39d92182 100644
a2f31b
--- a/xmlschemas.c
a2f31b
+++ b/xmlschemas.c
a2f31b
@@ -28090,7 +28090,6 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
a2f31b
     vctxt->nberrors = 0;
a2f31b
     vctxt->depth = -1;
a2f31b
     vctxt->skipDepth = -1;
a2f31b
-    vctxt->xsiAssemble = 0;
a2f31b
     vctxt->hasKeyrefs = 0;
a2f31b
 #ifdef ENABLE_IDC_NODE_TABLES_TEST
a2f31b
     vctxt->createIDCNodeTables = 1;
a2f31b
-- 
a2f31b
2.24.1
a2f31b