mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
24 lines
652 B
Plaintext
24 lines
652 B
Plaintext
import codeql.ruby.AST
|
|
import utils.test.InlineExpectationsTest
|
|
import codeql.ruby.security.ImproperMemoizationQuery
|
|
|
|
module ImproperMemoizationTest implements TestSig {
|
|
string getARelevantTag() { result = "result" }
|
|
|
|
predicate hasActualResult(Location location, string element, string tag, string value) {
|
|
tag = "result" and
|
|
value = "BAD" and
|
|
exists(Expr e |
|
|
isImproperMemoizationMethod(e, _, _) and
|
|
location = e.getLocation() and
|
|
element = e.toString()
|
|
)
|
|
}
|
|
}
|
|
|
|
import MakeTest<ImproperMemoizationTest>
|
|
|
|
from Method m, Parameter p, AssignLogicalOrExpr s
|
|
where isImproperMemoizationMethod(m, p, s)
|
|
select m, p, s
|