void-packages/srcpkgs/libxml2/patches/CVE-2017-7375.patch
Helmut Pozimski 40a5a0c7fa libxml2: add patches for multiple CVEs
patches from the GNOME libxml2 git repository at https://git.gnome.org/browse/libxml2/ , revisions:

CVE-2016-4658 c1d1f7121194036608bf555f08d3062a36fd344b
CVE-2016-5131 a005199330b86dada19d162cae15ef9bdcb6baa8 and 9ab01a277d71f54d3143c2cf333c5c2e9aaedd9e
CVE-2017-0663 92b9e8c8b3787068565a1820ba575d042f9eec66
CVE-2017-7375 90ccb58242866b0ba3edbef8fe44214a101c2b3e
CVE-2017-7376 5dca9eea1bd4263bfa4d037ab2443de1cd730f7e
CVE-2017-9047 932cc9896ab41475d4aa429c27d9afd175959d74
CVE-2017-9048 932cc9896ab41475d4aa429c27d9afd175959d74
CVE-2017-9049 e26630548e7d138d2c560844c43820b6767251e3
CVE-2017-9050 e26630548e7d138d2c560844c43820b6767251e3
2017-08-24 15:49:50 +02:00

35 lines
1 KiB
Diff

From 90ccb58242866b0ba3edbef8fe44214a101c2b3e Mon Sep 17 00:00:00 2001
From: Neel Mehta <nmehta@google.com>
Date: Fri, 7 Apr 2017 17:43:02 +0200
Subject: Prevent unwanted external entity reference
For https://bugzilla.gnome.org/show_bug.cgi?id=780691
* parser.c: add a specific check to avoid PE reference
---
parser.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/parser.c b/parser.c
index 609a270..c2c812d 100644
--- parser.c
+++ parser.c
@@ -8123,6 +8123,15 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt)
if (xmlPushInput(ctxt, input) < 0)
return;
} else {
+ if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
+ ((ctxt->options & XML_PARSE_NOENT) == 0) &&
+ ((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
+ ((ctxt->options & XML_PARSE_DTDLOAD) == 0) &&
+ ((ctxt->options & XML_PARSE_DTDATTR) == 0) &&
+ (ctxt->replaceEntities == 0) &&
+ (ctxt->validate == 0))
+ return;
+
/*
* TODO !!!
* handle the extra spaces added before and after
--
cgit v0.12