Skip to content

Commit c68d90f

Browse files
committed
Fix XmlDataConnection (#3346)
1 parent 637e764 commit c68d90f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Adapter/MSTestAdapter.PlatformServices/Data/XmlDataConnection.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Microsoft Corporation. All rights reserved.
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33

44
#if NETFRAMEWORK
@@ -96,13 +96,15 @@ public XmlDataConnection(string fileName, List<string> dataFolders)
9696
Locale = CultureInfo.CurrentCulture,
9797
};
9898
string path = FixPath(_fileName) ?? Path.GetFullPath(_fileName);
99+
100+
// ReadXmlSchema and ReadXml should use the overload with XmlReader to avoid DTD processing
99101
if (schemaOnly)
100102
{
101-
dataSet.ReadXmlSchema(path);
103+
dataSet.ReadXmlSchema(new XmlTextReader(path));
102104
}
103105
else
104106
{
105-
dataSet.ReadXml(path);
107+
dataSet.ReadXml(new XmlTextReader(path));
106108
}
107109

108110
return dataSet;

0 commit comments

Comments
 (0)