From fb7e431ac8d20db2cf9f6852b4a1fc5de77f3ce5 Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Tue, 28 Jun 2016 20:42:59 +0200 Subject: [PATCH] Ignore DTD when reading XML PList documents --- plist-cil/XmlPropertyListParser.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plist-cil/XmlPropertyListParser.cs b/plist-cil/XmlPropertyListParser.cs index 31a05b4..b8a42ce 100644 --- a/plist-cil/XmlPropertyListParser.cs +++ b/plist-cil/XmlPropertyListParser.cs @@ -72,7 +72,14 @@ namespace Claunia.PropertyList public static NSObject Parse(Stream str) { XmlDocument doc = new XmlDocument(); - doc.Load(str); + + XmlReaderSettings settings = new XmlReaderSettings(); + settings.DtdProcessing = DtdProcessing.Ignore; + + using (XmlReader reader = XmlReader.Create(str, settings)) + { + doc.Load(reader); + } return ParseDocument(doc); }