Python: Handle readline, readlines for ExternalFileObject

This commit is contained in:
Rasmus Wriedt Larsen
2020-04-23 10:37:16 +02:00
parent 7385ea5024
commit 86630f1d6c
3 changed files with 7 additions and 3 deletions

View File

@@ -191,7 +191,9 @@ class ExternalFileObject extends TaintKind {
TaintKind getValue() { result = valueKind }
override TaintKind getTaintOfMethodResult(string name) {
name = "read" and result = this.getValue()
name in ["read", "readline"] and result = this.getValue()
or
name = "readlines" and result.(SequenceKind).getItem() = this.getValue()
}
}