diff options
author | Alexander Dahl <ada@thorsis.com> | 2020-03-18 14:27:16 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-03-20 13:37:11 +0100 |
commit | 7eee65f5a0d24b8f1542c79563cf85f2b1d41692 (patch) | |
tree | 02cf347d408756a7fdb6f7366e2c278510aff822 /patches | |
parent | 66503a69df12882a6b055f312cecdc2433c2de22 (diff) | |
download | ptxdist-7eee65f5a0d24b8f1542c79563cf85f2b1d41692.tar.gz ptxdist-7eee65f5a0d24b8f1542c79563cf85f2b1d41692.tar.xz |
libxml2: Add upstream patch fixing CVE-2019-20388
Signed-off-by: Alexander Dahl <ada@thorsis.com>
Message-Id: <20200318132716.10624-5-ada@thorsis.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches')
-rw-r--r-- | patches/libxml2-2.9.10/0002-Fix-memory-leak-in-xmlSchemaValidateStream.patch | 29 | ||||
-rw-r--r-- | patches/libxml2-2.9.10/series | 3 |
2 files changed, 31 insertions, 1 deletions
diff --git a/patches/libxml2-2.9.10/0002-Fix-memory-leak-in-xmlSchemaValidateStream.patch b/patches/libxml2-2.9.10/0002-Fix-memory-leak-in-xmlSchemaValidateStream.patch new file mode 100644 index 000000000..1ca086217 --- /dev/null +++ b/patches/libxml2-2.9.10/0002-Fix-memory-leak-in-xmlSchemaValidateStream.patch @@ -0,0 +1,29 @@ +From: Zhipeng Xie <xiezhipeng1@huawei.com> +Date: Tue, 20 Aug 2019 16:33:06 +0800 +Subject: [PATCH] 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. + +Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com> +--- + xmlschemas.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/xmlschemas.c b/xmlschemas.c +index d19de6df5f50..59495c2738ab 100644 +--- a/xmlschemas.c ++++ b/xmlschemas.c +@@ -28095,7 +28095,6 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) { + vctxt->nberrors = 0; + vctxt->depth = -1; + vctxt->skipDepth = -1; +- vctxt->xsiAssemble = 0; + vctxt->hasKeyrefs = 0; + #ifdef ENABLE_IDC_NODE_TABLES_TEST + vctxt->createIDCNodeTables = 1; diff --git a/patches/libxml2-2.9.10/series b/patches/libxml2-2.9.10/series index b8e92fb7a..fed72960d 100644 --- a/patches/libxml2-2.9.10/series +++ b/patches/libxml2-2.9.10/series @@ -2,6 +2,7 @@ #tag:base --start-number 1 #tag:upstream --start-number 1 0001-Fix-infinite-loop-in-xmlStringLenDecodeEntities.patch +0002-Fix-memory-leak-in-xmlSchemaValidateStream.patch #tag:ptx --start-number 200 0200-xml2-config-is-not-SYSROOT-aware.patch -# 0a9081f5db07b8cbb593bc669a7603c7 - git-ptx-patches magic +# d6f49636e8813a3a9e46758f352fc667 - git-ptx-patches magic |