[CVE-2019-20388] Fix memory leak in xmlSchemaValidateStream 97/286697/1
authorZhipeng Xie <xiezhipeng1@huawei.com>
Tue, 20 Aug 2019 08:33:06 +0000 (16:33 +0800)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 12 Jan 2023 01:04:14 +0000 (10:04 +0900)
commitfd644d554e894f3d3d33ba726511eab178535256
tree09387b042133a7678652cdd31b271318665a7dab
parent98ca95e2597f3711d72b7578a41ec46607fb80c4
[CVE-2019-20388] Fix memory leak in xmlSchemaValidateStream

When ctxt->schema is NULL, xmlSchemaSAXPlug->xmlSchemaPreRun
alloc a new schema for ctxt->schema and set vctxt->xsiAssemble
to 1. Then xmlSchemaVStart->xmlSchemaPreRun initialize
vctxt->xsiAssemble to 0 again which cause the alloced schema
can not be freed anymore.

Found with libFuzzer.

Change-Id: I19755ffa6ff031a6d5ba2b7daa82ad1b8a3b9362
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
xmlschemas.c