Skip to content

Commit 0471471

Browse files
authored
Merge pull request #1109 from hvitved/csharp/conditional-bypass
C#: Fix performance regression in `cs/user-controlled-bypass`
2 parents 95eb4cf + 84c3073 commit 0471471

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

csharp/ql/src/semmle/code/csharp/security/dataflow/ConditionalBypass.qll

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,18 @@ module UserControlledBypassOfSensitiveMethod {
5757
}
5858
}
5959

60+
pragma[noinline]
61+
private predicate conditionControlsCall0(
62+
SensitiveExecutionMethodCall call, Expr e, ControlFlow::SuccessorTypes::BooleanSuccessor s
63+
) {
64+
forex(BasicBlock bb | bb = call.getAControlFlowNode().getBasicBlock() | e.controlsBlock(bb, s))
65+
}
66+
6067
private predicate conditionControlsCall(
6168
SensitiveExecutionMethodCall call, SensitiveExecutionMethod def, Expr e, boolean cond
6269
) {
6370
exists(ControlFlow::SuccessorTypes::BooleanSuccessor s | cond = s.getValue() |
64-
e.controlsElement(call, s)
71+
conditionControlsCall0(call, e, s)
6572
) and
6673
def = call.getTarget()
6774
}

0 commit comments

Comments
 (0)