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 {
227227}
228228
229229class UpperBoundCheck extends BarrierFlowStateTransformer {
230- MaxValueState state1 ;
231230 UpperBoundCheckGuard g ;
232231
233232 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 )
236234 }
237235
238- override predicate barrierFor ( MaxValueState flowstate ) { flowstate = state1 }
236+ override predicate barrierFor ( MaxValueState flowstate ) {
237+ g .isBoundFor2 ( flowstate .getBitSize ( ) , flowstate .getSinkBitSize ( ) )
238+ }
239239
240240 override MaxValueState transform ( MaxValueState state ) {
241- state = state1 and
241+ this . barrierFor ( state ) and
242242 result .getBitSize ( ) =
243243 max ( int bitsize |
244244 bitsize = validBitSize ( ) and
245- bitsize < state1 .getBitSize ( ) and
245+ bitsize < state .getBitSize ( ) and
246246 not g .isBoundFor2 ( bitsize , state .getSinkBitSize ( ) )
247247 |
248248 bitsize
249249 ) and
250- if exists ( state1 .getArchitectureBitSize ( ) )
251- then result .getArchitectureBitSize ( ) = state1 .getArchitectureBitSize ( )
250+ if exists ( state .getArchitectureBitSize ( ) )
251+ then result .getArchitectureBitSize ( ) = state .getArchitectureBitSize ( )
252252 else not exists ( result .getArchitectureBitSize ( ) )
253253 }
254254}
You can’t perform that action at this time.
0 commit comments