diff options
author | Mike Frysinger <vapier@chromium.org> | 2019-01-03 06:08:40 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2019-01-03 06:21:38 -0500 |
commit | 2ad6bf6d6f3dbe00df33a5399c6762fb0ae1867f (patch) | |
tree | ba93cc18c3e55edb2bb23942bdc13e6648bbb34a /dev-libs/libxml2/files | |
parent | net-libs/miniupnpc: s390 stable wrt bug #665412 (diff) | |
download | gentoo-2ad6bf6d6f3dbe00df33a5399c6762fb0ae1867f.tar.gz gentoo-2ad6bf6d6f3dbe00df33a5399c6762fb0ae1867f.tar.bz2 gentoo-2ad6bf6d6f3dbe00df33a5399c6762fb0ae1867f.zip |
dev-libs/libxml2: fix CVE-2017-8872 #618110
Bug: https://bugs.gentoo.org/618110
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'dev-libs/libxml2/files')
-rw-r--r-- | dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch new file mode 100644 index 000000000000..6062f63df9ea --- /dev/null +++ b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch @@ -0,0 +1,65 @@ +https://bugs.gentoo.org/618110 +https://bugzilla.gnome.org/show_bug.cgi?id=775200 +https://gitlab.gnome.org/GNOME/libxml2/issues/26 + +From 123234f2cfcd9e9b9f83047eee1dc17b4c3f4407 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer <wellnhofer@aevum.de> +Date: Tue, 11 Sep 2018 14:52:07 +0200 +Subject: [PATCH] Free input buffer in xmlHaltParser + +This avoids miscalculation of available bytes. + +Thanks to Yunho Kim for the report. + +Closes: #26 +--- + parser.c | 5 +++++ + result/errors/759573.xml.err | 17 +++++++---------- + 2 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/parser.c b/parser.c +index ca9fde2c8758..5813a6643e15 100644 +--- a/parser.c ++++ b/parser.c +@@ -12462,7 +12462,12 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) { + ctxt->input->free((xmlChar *) ctxt->input->base); + ctxt->input->free = NULL; + } ++ if (ctxt->input->buf != NULL) { ++ xmlFreeParserInputBuffer(ctxt->input->buf); ++ ctxt->input->buf = NULL; ++ } + ctxt->input->cur = BAD_CAST""; ++ ctxt->input->length = 0; + ctxt->input->base = ctxt->input->cur; + ctxt->input->end = ctxt->input->cur; + } +diff --git a/result/errors/759573.xml.err b/result/errors/759573.xml.err +index 554039f65b91..38ef5c40b8e3 100644 +--- a/result/errors/759573.xml.err ++++ b/result/errors/759573.xml.err +@@ -21,14 +21,11 @@ Entity: line 1: + ^ + ./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration + +-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ00 +- ^ ++ ++^ + ./test/errors/759573.xml:1: parser error : DOCTYPE improperly terminated +-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ00 +- ^ +-./test/errors/759573.xml:1: parser error : StartTag: invalid element name +-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ00 +- ^ +-./test/errors/759573.xml:1: parser error : Extra content at the end of the document +-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '%<![INCLUDE[000%ஸ00 +- ^ ++ ++^ ++./test/errors/759573.xml:1: parser error : Start tag expected, '<' not found ++ ++^ +-- +2.19.1 + |