Skip to content

Commit e66a3c4

Browse files
committed
Data flow: Add consistency checks for parameter positions
1 parent 79d8444 commit e66a3c4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,20 @@ module Consistency {
244244
not callable = viableCallable(call) and
245245
not any(ConsistencyConfiguration c).viableImplInCallContextTooLargeExclude(call, ctx, callable)
246246
}
247+
248+
query predicate uniqueParameterNodeAtPosition(
249+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
250+
) {
251+
isParameterNode(p, c, pos) and
252+
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
253+
msg = "Parameters with overlapping positions."
254+
}
255+
256+
query predicate uniqueParameterNodePosition(
257+
DataFlowCallable c, ParameterPosition pos, Node p, string msg
258+
) {
259+
isParameterNode(p, c, pos) and
260+
not exists(unique(ParameterPosition pos0 | isParameterNode(p, c, pos0))) and
261+
msg = "Parameter node with multiple positions."
262+
}
247263
}

0 commit comments

Comments
 (0)