mirror of
https://github.com/hohn/codeql-dataflow-sql-injection-go.git
synced 2025-12-16 10:13:04 +01:00
initial generated files
This commit is contained in:
20
SourceGetUserInfo.ql
Normal file
20
SourceGetUserInfo.ql
Normal file
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Identify the source: the return value of function `getUserInfo`.
|
||||
* Uses AST matching to find return expressions within that function.
|
||||
*/
|
||||
|
||||
import go
|
||||
|
||||
/** A source expression corresponding to the value returned from getUserInfo. */
|
||||
predicate isSource(Expr e) {
|
||||
exists(Function f, ReturnStmt r, int i |
|
||||
f.getName() = "getUserInfo" and
|
||||
r.getEnclosingFunction() = f and
|
||||
e = r.getExpr(i)
|
||||
)
|
||||
}
|
||||
|
||||
from Expr e
|
||||
where isSource(e)
|
||||
select e, "Source: return value of getUserInfo"
|
||||
|
||||
Reference in New Issue
Block a user