Skip to content

Commit 75b13da

Browse files
committed
Ruby: Block flow from LHS of && expressions
The only values that can flow from the LHS of an && expression are `false` and `nil`, neither of which seem relevant for any of our queries.
1 parent aeae208 commit 75b13da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,10 @@ module LocalFlow {
220220
or
221221
nodeTo.asExpr() =
222222
any(CfgNodes::ExprNodes::BinaryOperationCfgNode op |
223-
op.getExpr() instanceof BinaryLogicalOperation and
223+
op.getExpr() instanceof LogicalOrExpr and
224224
nodeFrom.asExpr() = op.getAnOperand()
225+
or
226+
op.getExpr() instanceof LogicalAndExpr and nodeFrom.asExpr() = op.getRightOperand()
225227
)
226228
or
227229
nodeTo.(ParameterNodeImpl).getParameter() =

0 commit comments

Comments
 (0)