Skip to content

Commit 4bf2a51

Browse files
committed
C#: XmlDocument only has instance Load methods.
1 parent 376ee33 commit 4bf2a51

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

csharp/ql/lib/semmle/code/csharp/frameworks/system/Xml.qll

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ class SystemXmlXmlDocumentClass extends Class {
3636
/** Gets the `Load` method. */
3737
Method getLoadMethod() {
3838
result = this.getAMethod() and
39-
result.hasName("Load") and
40-
result.isStatic()
39+
result.hasName("Load")
4140
}
4241
}
4342

csharp/ql/test/library-tests/dataflow/library/FlowSummaries.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,6 +2310,10 @@
23102310
| System.Xml;XmlDeclaration;false;get_Name;();;Argument[-1];ReturnValue;taint |
23112311
| System.Xml;XmlDeclaration;false;get_NodeType;();;Argument[-1];ReturnValue;taint |
23122312
| System.Xml;XmlDeclaration;false;get_Value;();;Argument[-1];ReturnValue;taint |
2313+
| System.Xml;XmlDocument;false;Load;(System.IO.Stream);;Argument[0];Argument[-1];taint |
2314+
| System.Xml;XmlDocument;false;Load;(System.IO.TextReader);;Argument[0];Argument[-1];taint |
2315+
| System.Xml;XmlDocument;false;Load;(System.String);;Argument[0];Argument[-1];taint |
2316+
| System.Xml;XmlDocument;false;Load;(System.Xml.XmlReader);;Argument[0];Argument[-1];taint |
23132317
| System.Xml;XmlDocument;false;get_BaseURI;();;Argument[-1];ReturnValue;taint |
23142318
| System.Xml;XmlDocument;false;get_InnerXml;();;Argument[-1];ReturnValue;taint |
23152319
| System.Xml;XmlDocument;false;get_IsReadOnly;();;Argument[-1];ReturnValue;taint |

csharp/ql/test/library-tests/dataflow/library/FlowSummariesFiltered.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,10 @@
16151615
| System.Xml.Serialization;XmlSchemas;false;get_Item;(System.String);;Element of Argument[-1];ReturnValue;value |
16161616
| System.Xml.Serialization;XmlSchemas;false;set_Item;(System.Int32,System.Xml.Schema.XmlSchema);;Argument[1];Element of Argument[-1];value |
16171617
| System.Xml;XmlAttributeCollection;false;CopyTo;(System.Xml.XmlAttribute[],System.Int32);;Element of Argument[-1];Element of Argument[0];value |
1618+
| System.Xml;XmlDocument;false;Load;(System.IO.Stream);;Argument[0];Argument[-1];taint |
1619+
| System.Xml;XmlDocument;false;Load;(System.IO.TextReader);;Argument[0];Argument[-1];taint |
1620+
| System.Xml;XmlDocument;false;Load;(System.String);;Argument[0];Argument[-1];taint |
1621+
| System.Xml;XmlDocument;false;Load;(System.Xml.XmlReader);;Argument[0];Argument[-1];taint |
16181622
| System.Xml;XmlNamedNodeMap;false;GetNamedItem;(System.String);;Argument[-1];ReturnValue;value |
16191623
| System.Xml;XmlNamedNodeMap;false;GetNamedItem;(System.String,System.String);;Argument[-1];ReturnValue;value |
16201624
| System.Xml;XmlNode;false;GetEnumerator;();;Element of Argument[-1];Property[System.Collections.IEnumerator.Current] of ReturnValue;value |

0 commit comments

Comments
 (0)