mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Python: Refactor ExternalFileObject to use field
Instead of string matching. This brings it in line with what CollectionKind, SequenceKind, and DictKind does.
This commit is contained in:
@@ -183,10 +183,12 @@ private predicate urlparse(ControlFlowNode fromnode, CallNode tonode) {
|
||||
|
||||
/** A kind of "taint", representing an open file-like object from an external source. */
|
||||
class ExternalFileObject extends TaintKind {
|
||||
ExternalFileObject() { this = "file[" + any(ExternalStringKind key) + "]" }
|
||||
ExternalStringKind valueKind;
|
||||
|
||||
ExternalFileObject() { this = "file[" + valueKind + "]" }
|
||||
|
||||
/** Gets the taint kind for the contents of this file */
|
||||
TaintKind getValue() { this = "file[" + result + "]" }
|
||||
TaintKind getValue() { result = valueKind }
|
||||
|
||||
override TaintKind getTaintOfMethodResult(string name) {
|
||||
name = "read" and result = this.getValue()
|
||||
|
||||
Reference in New Issue
Block a user