summarylogtreecommitdiffstats
path: root/blink-disable-XML-catalogs-at-runtime.patch
diff options
context:
space:
mode:
Diffstat (limited to 'blink-disable-XML-catalogs-at-runtime.patch')
-rw-r--r--blink-disable-XML-catalogs-at-runtime.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/blink-disable-XML-catalogs-at-runtime.patch b/blink-disable-XML-catalogs-at-runtime.patch
new file mode 100644
index 000000000000..ec2361e2603a
--- /dev/null
+++ b/blink-disable-XML-catalogs-at-runtime.patch
@@ -0,0 +1,47 @@
+From 8f0c8c8d9bce12c70ce9acb4a7474cd15c9be65b Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppymaster@gmail.com>
+Date: Wed, 20 Jun 2018 20:37:46 +0000
+Subject: [PATCH] blink: disable XML catalogs at runtime
+
+Chromium may optionally be built against libxml installed on the system.
+The system libxml commonly has XML catalog support enabled. Disable it
+by calling xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE).
+
+Bug: https://bugs.gentoo.org/653078
+Change-Id: I069f6dcecf81168f9d31eb0efe2519197ec8e779
+Reviewed-on: https://chromium-review.googlesource.com/1103710
+Reviewed-by: Daniel Cheng <dcheng@chromium.org>
+Commit-Queue: Scott Graham <scottmg@chromium.org>
+Cr-Commit-Position: refs/heads/master@{#568998}
+---
+ .../blink/renderer/core/xml/parser/xml_document_parser.cc | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc b/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
+index 9744de383d9a..d0539f61e4b5 100644
+--- a/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
++++ b/third_party/blink/renderer/core/xml/parser/xml_document_parser.cc
+@@ -28,6 +28,10 @@
+
+ #include <libxml/parser.h>
+ #include <libxml/parserInternals.h>
++#include <libxml/xmlversion.h>
++#if defined(LIBXML_CATALOG_ENABLED)
++#include <libxml/catalog.h>
++#endif
+ #include <libxslt/xslt.h>
+
+ #include <memory>
+@@ -648,6 +652,9 @@ static void InitializeLibXMLIfNecessary() {
+ if (did_init)
+ return;
+
++#if defined(LIBXML_CATALOG_ENABLED)
++ xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
++#endif
+ xmlInitParser();
+ xmlRegisterInputCallbacks(MatchFunc, OpenFunc, ReadFunc, CloseFunc);
+ xmlRegisterOutputCallbacks(MatchFunc, OpenFunc, WriteFunc, CloseFunc);
+--
+2.17.1
+