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

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