Use existing predicate

There already exists the predicate
implements(string pkg, string tp, string name)
which does exactly what this code does
This commit is contained in:
Owen Mansel-Chan
2020-12-03 15:55:11 +00:00
parent 3f1197d605
commit fe1f08fb12

View File

@@ -10,10 +10,8 @@ private class JsonIteratorUnmarshalFunction extends TaintTracking::FunctionModel
JsonIteratorUnmarshalFunction() {
this.hasQualifiedName("github.com/json-iterator/go", ["Unmarshal", "UnmarshalFromString"])
or
exists(Method m |
m.hasQualifiedName("github.com/json-iterator/go", "API", ["Unmarshal", "UnmarshalFromString"]) and
this.(Method).implements(m)
)
this.(Method)
.implements("github.com/json-iterator/go", "API", ["Unmarshal", "UnmarshalFromString"])
}
override DataFlow::FunctionInput getAnInput() { result.isParameter(0) }