Skip to content

Commit c084936

Browse files
committed
CPP: Speed up ExistsAnyFlowConfig.
1 parent 6a865ed commit c084936

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cpp/ql/src/Likely Bugs/Protocols/boostorg/TlsSettingsMisconfiguration.ql

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,22 @@ import semmle.code.cpp.security.boostorg.asio.protocols
1313
class ExistsAnyFlowConfig extends DataFlow::Configuration {
1414
ExistsAnyFlowConfig() { this = "ExistsAnyFlowConfig" }
1515

16-
override predicate isSource(DataFlow::Node source) { any() }
16+
override predicate isSource(DataFlow::Node source) {
17+
source.asExpr() instanceof ConstructorCall
18+
}
1719

1820
override predicate isSink(DataFlow::Node sink) { any() }
1921
}
2022

2123
bindingset[flag]
2224
predicate isOptionSet(ConstructorCall cc, int flag, FunctionCall fcSetOptions) {
2325
exists(
24-
BoostorgAsio::SslContextFlowsToSetOptionConfig config, ExistsAnyFlowConfig testConfig,
26+
BoostorgAsio::SslContextFlowsToSetOptionConfig config, ExistsAnyFlowConfig anyFlowConfig,
2527
Expr optionsSink
2628
|
2729
config.hasFlow(DataFlow::exprNode(cc), DataFlow::exprNode(optionsSink)) and
2830
exists(VariableAccess contextSetOptions |
29-
testConfig.hasFlow(DataFlow::exprNode(cc), DataFlow::exprNode(contextSetOptions)) and
31+
anyFlowConfig.hasFlow(DataFlow::exprNode(cc), DataFlow::exprNode(contextSetOptions)) and
3032
exists(BoostorgAsio::SslSetOptionsFunction f | f.getACallToThisFunction() = fcSetOptions |
3133
contextSetOptions = fcSetOptions.getQualifier() and
3234
forall(

0 commit comments

Comments
 (0)