@@ -78,7 +78,7 @@ predicate isInvalidPointerDerefSink2(DataFlow::Node sink, Instruction i, string
7878 )
7979}
8080
81- predicate pointerArithOverflow (
81+ predicate pointerArithOverflow0 (
8282 PointerArithmeticInstruction pai , Field f , int size , int bound , int delta
8383) {
8484 pai .getElementSize ( ) = f .getUnspecifiedType ( ) .( ArrayType ) .getBaseType ( ) .getSize ( ) and
@@ -89,14 +89,21 @@ predicate pointerArithOverflow(
8989
9090module PointerArithmeticToDerefConfig implements DataFlow:: ConfigSig {
9191 predicate isSource ( DataFlow:: Node source ) {
92- pointerArithOverflow ( source .asInstruction ( ) , _, _, _, _)
92+ pointerArithOverflow0 ( source .asInstruction ( ) , _, _, _, _)
9393 }
9494
9595 predicate isSink ( DataFlow:: Node sink ) { isInvalidPointerDerefSink1 ( sink , _, _) }
9696}
9797
9898module PointerArithmeticToDerefFlow = DataFlow:: Global< PointerArithmeticToDerefConfig > ;
9999
100+ predicate pointerArithOverflow (
101+ PointerArithmeticInstruction pai , Field f , int size , int bound , int delta
102+ ) {
103+ pointerArithOverflow0 ( pai , f , size , bound , delta ) and
104+ PointerArithmeticToDerefFlow:: flow ( DataFlow:: instructionNode ( pai ) , _)
105+ }
106+
100107module FieldAddressToDerefConfig implements DataFlow:: StateConfigSig {
101108 newtype FlowState =
102109 additional TArray ( Field f ) { pointerArithOverflow ( _, f , _, _, _) } or
0 commit comments