mirror of
https://github.com/github/codeql.git
synced 2026-01-29 14:23:03 +01:00
Remove uses of getEnclosingCallable
This commit is contained in:
committed by
Owen Mansel-Chan
parent
30ab22f5a6
commit
d62f417130
@@ -72,9 +72,7 @@ module InsecureRandomness {
|
||||
*/
|
||||
class PasswordFnSink extends Sink {
|
||||
PasswordFnSink() {
|
||||
this.getEnclosingCallable()
|
||||
.getName()
|
||||
.regexpMatch("(?i).*(gen(erate)?|salt|make|mk)Password.*")
|
||||
this.getRoot().(FuncDef).getName().regexpMatch("(?i).*(gen(erate)?|salt|make|mk)Password.*")
|
||||
}
|
||||
|
||||
override string getKind() { result = "a password-related function" }
|
||||
|
||||
@@ -86,7 +86,7 @@ module UnsafeUnzipSymlink {
|
||||
* Gets a `CallNode` that may call `node`'s enclosing function.
|
||||
*/
|
||||
private DataFlow::CallNode getACaller(DataFlow::CallNode node) {
|
||||
result.getACallee() = node.getEnclosingCallable()
|
||||
result.getACallee().getFuncDef() = node.getRoot()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,7 +20,7 @@ predicate isDeferred(DataFlow::CallNode call) {
|
||||
from DataFlow::CallNode recoverCall, FuncDef f, string msg
|
||||
where
|
||||
recoverCall.getTarget() = Builtin::recover() and
|
||||
f = recoverCall.getEnclosingCallable().getFuncDef() and
|
||||
f = recoverCall.getRoot() and
|
||||
(
|
||||
isDeferred(recoverCall) and
|
||||
msg = "Deferred calls to 'recover' have no effect."
|
||||
|
||||
@@ -24,7 +24,7 @@ where
|
||||
sink =
|
||||
min(DataFlow::PathNode sink2, int line |
|
||||
cfg.hasFlowPath(_, sink2) and
|
||||
sink2.getNode().getEnclosingCallable() = sink.getNode().getEnclosingCallable() and
|
||||
sink2.getNode().getRoot() = sink.getNode().getRoot() and
|
||||
sink2.hasLocationInfo(_, line, _, _, _)
|
||||
|
|
||||
sink2 order by line
|
||||
|
||||
Reference in New Issue
Block a user