xzyang / rpms / libxml2

Forked from rpms/libxml2 3 years ago
Clone

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

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