]>
Commit | Line | Data |
---|---|---|
2247840c JB |
1 | From 6088a74bcf7d0c42e24cff4594d804e1d3c9fbca Mon Sep 17 00:00:00 2001 |
2 | From: Zhipeng Xie <xiezhipeng1@huawei.com> | |
3 | Date: Tue, 20 Aug 2019 16:33:06 +0800 | |
4 | Subject: [PATCH] Fix memory leak in xmlSchemaValidateStream | |
5 | ||
6 | When ctxt->schema is NULL, xmlSchemaSAXPlug->xmlSchemaPreRun | |
7 | alloc a new schema for ctxt->schema and set vctxt->xsiAssemble | |
8 | to 1. Then xmlSchemaVStart->xmlSchemaPreRun initialize | |
9 | vctxt->xsiAssemble to 0 again which cause the alloced schema | |
10 | can not be freed anymore. | |
11 | ||
12 | Found with libFuzzer. | |
13 | ||
14 | Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com> | |
15 | --- | |
16 | xmlschemas.c | 1 - | |
17 | 1 file changed, 1 deletion(-) | |
18 | ||
19 | diff --git a/xmlschemas.c b/xmlschemas.c | |
20 | index 301c8449..39d92182 100644 | |
21 | --- a/xmlschemas.c | |
22 | +++ b/xmlschemas.c | |
23 | @@ -28090,7 +28090,6 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) { | |
24 | vctxt->nberrors = 0; | |
25 | vctxt->depth = -1; | |
26 | vctxt->skipDepth = -1; | |
27 | - vctxt->xsiAssemble = 0; | |
28 | vctxt->hasKeyrefs = 0; | |
29 | #ifdef ENABLE_IDC_NODE_TABLES_TEST | |
30 | vctxt->createIDCNodeTables = 1; | |
31 | -- | |
32 | 2.24.1 | |
33 |