File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed
ruby/ql/lib/codeql/ruby/dataflow/internal
shared/dataflow/codeql/dataflow Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -31,4 +31,6 @@ module RubyDataFlow implements InputSig {
31
31
predicate mayBenefitFromCallContext = Private:: mayBenefitFromCallContext / 1 ;
32
32
33
33
predicate viableImplInCallContext = Private:: viableImplInCallContext / 2 ;
34
+
35
+ predicate ignoreFieldFlowBranchLimit ( DataFlowCallable c ) { exists ( c .asLibraryCallable ( ) ) }
34
36
}
Original file line number Diff line number Diff line change @@ -273,6 +273,9 @@ signature module InputSig {
273
273
) {
274
274
any ( )
275
275
}
276
+
277
+ /** Holds if `fieldFlowBranchLimit` should be ignored for flow going into/out of `c`. */
278
+ default predicate ignoreFieldFlowBranchLimit ( DataFlowCallable c ) { none ( ) }
276
279
}
277
280
278
281
module Configs< InputSig Lang> {
Original file line number Diff line number Diff line change @@ -1117,7 +1117,9 @@ module MakeImpl<InputSig Lang> {
1117
1117
exists ( int b , int j |
1118
1118
b = branch ( ret ) and
1119
1119
j = join ( out ) and
1120
- if b .minimum ( j ) <= Config:: fieldFlowBranchLimit ( )
1120
+ if
1121
+ b .minimum ( j ) <= Config:: fieldFlowBranchLimit ( ) or
1122
+ ignoreFieldFlowBranchLimit ( ret .getEnclosingCallable ( ) )
1121
1123
then allowsFieldFlow = true
1122
1124
else allowsFieldFlow = false
1123
1125
)
@@ -1136,7 +1138,9 @@ module MakeImpl<InputSig Lang> {
1136
1138
exists ( int b , int j |
1137
1139
b = branch ( arg ) and
1138
1140
j = join ( p ) and
1139
- if b .minimum ( j ) <= Config:: fieldFlowBranchLimit ( )
1141
+ if
1142
+ b .minimum ( j ) <= Config:: fieldFlowBranchLimit ( ) or
1143
+ ignoreFieldFlowBranchLimit ( p .getEnclosingCallable ( ) )
1140
1144
then allowsFieldFlow = true
1141
1145
else allowsFieldFlow = false
1142
1146
)
You can’t perform that action at this time.
0 commit comments