File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
go/ql/lib/semmle/go/security Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -227,28 +227,28 @@ abstract class BarrierFlowStateTransformer extends DataFlow::Node {
227
227
}
228
228
229
229
class UpperBoundCheck extends BarrierFlowStateTransformer {
230
- MaxValueState state1 ;
231
230
UpperBoundCheckGuard g ;
232
231
233
232
UpperBoundCheck ( ) {
234
- this = DataFlow:: BarrierGuard< upperBoundCheckGuard / 3 > :: getABarrierNodeForGuard ( g ) and
235
- g .isBoundFor2 ( state1 .getBitSize ( ) , state1 .getSinkBitSize ( ) )
233
+ this = DataFlow:: BarrierGuard< upperBoundCheckGuard / 3 > :: getABarrierNodeForGuard ( g )
236
234
}
237
235
238
- override predicate barrierFor ( MaxValueState flowstate ) { flowstate = state1 }
236
+ override predicate barrierFor ( MaxValueState flowstate ) {
237
+ g .isBoundFor2 ( flowstate .getBitSize ( ) , flowstate .getSinkBitSize ( ) )
238
+ }
239
239
240
240
override MaxValueState transform ( MaxValueState state ) {
241
- state = state1 and
241
+ this . barrierFor ( state ) and
242
242
result .getBitSize ( ) =
243
243
max ( int bitsize |
244
244
bitsize = validBitSize ( ) and
245
- bitsize < state1 .getBitSize ( ) and
245
+ bitsize < state .getBitSize ( ) and
246
246
not g .isBoundFor2 ( bitsize , state .getSinkBitSize ( ) )
247
247
|
248
248
bitsize
249
249
) and
250
- if exists ( state1 .getArchitectureBitSize ( ) )
251
- then result .getArchitectureBitSize ( ) = state1 .getArchitectureBitSize ( )
250
+ if exists ( state .getArchitectureBitSize ( ) )
251
+ then result .getArchitectureBitSize ( ) = state .getArchitectureBitSize ( )
252
252
else not exists ( result .getArchitectureBitSize ( ) )
253
253
}
254
254
}
You can’t perform that action at this time.
0 commit comments