mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Ruby: Update string const barrier guard
This change recognises guards like `FOO.include?`, where `FOO` is an array constant.
This commit is contained in:
@@ -64,7 +64,8 @@ class StringConstArrayInclusionCall extends DataFlow::BarrierGuard,
|
||||
StringConstArrayInclusionCall() {
|
||||
exists(ArrayLiteral aLit |
|
||||
this.getExpr().getMethodName() = "include?" and
|
||||
this.getExpr().getReceiver() = aLit
|
||||
[this.getExpr().getReceiver(), this.getExpr().getReceiver().(ConstantReadAccess).getValue()] =
|
||||
aLit
|
||||
|
|
||||
forall(Expr elem | elem = aLit.getAnElement() | elem instanceof StringLiteral) and
|
||||
this.getArgument(0) = checkedNode
|
||||
|
||||
Reference in New Issue
Block a user