Reuse existing class instead of repeating it

This is already done elsewhere.
This commit is contained in:
Owen Mansel-Chan
2021-01-20 16:11:33 +00:00
parent fbe0474d0c
commit 7339f3e095

View File

@@ -4,6 +4,7 @@
*/
import go
import semmle.go.dataflow.BarrierGuardUtil
/**
* Provides extension points for customizing the taint tracking configuration for reasoning about
@@ -133,18 +134,5 @@ module TaintedPath {
*
* This is overapproximate: we do not attempt to reason about the correctness of the regexp.
*/
class RegexpCheck extends SanitizerGuard {
RegexpMatchFunction matchfn;
DataFlow::CallNode call;
RegexpCheck() {
matchfn.getACall() = call and
this = matchfn.getResult().getNode(call).getASuccessor*()
}
override predicate checks(Expr e, boolean branch) {
e = matchfn.getValue().getNode(call).asExpr() and
(branch = false or branch = true)
}
}
class RegexpCheckAsSanitizerGuard extends RegexpCheck, SanitizerGuard { }
}