Merge pull request #252 from gagliardetto/patch-3

taint-tracking: String() must return a string type
This commit is contained in:
Max Schaefer
2020-07-08 12:01:20 +01:00
committed by GitHub

View File

@@ -6,7 +6,11 @@ import go
/** A `String()` method. */
class StringMethod extends TaintTracking::FunctionModel, Method {
StringMethod() { getName() = "String" and getNumParameter() = 0 }
StringMethod() {
getName() = "String" and
getNumParameter() = 0 and
getResultType(0) = Builtin::string_().getType()
}
override predicate hasTaintFlow(FunctionInput inp, FunctionOutput outp) {
inp.isReceiver() and outp.isResult()