mirror of
https://github.com/github/codeql.git
synced 2026-01-30 06:42:57 +01:00
Merge pull request #457 from owen-mc/cleanup-avoid-code-duplication
Reuse existing class instead of repeating it
This commit is contained in:
@@ -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 { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user