summarylogtreecommitdiffstats
path: root/blink-disable-XML-catalogs-at-runtime.patch
blob: ec2361e2603adc12e9aae26ea7a46d9129958a83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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