@@ -78,7 +78,7 @@ predicate isInvalidPointerDerefSink2(DataFlow::Node sink, Instruction i, string
78
78
)
79
79
}
80
80
81
- predicate pointerArithOverflow (
81
+ predicate pointerArithOverflow0 (
82
82
PointerArithmeticInstruction pai , Field f , int size , int bound , int delta
83
83
) {
84
84
pai .getElementSize ( ) = f .getUnspecifiedType ( ) .( ArrayType ) .getBaseType ( ) .getSize ( ) and
@@ -89,14 +89,21 @@ predicate pointerArithOverflow(
89
89
90
90
module PointerArithmeticToDerefConfig implements DataFlow:: ConfigSig {
91
91
predicate isSource ( DataFlow:: Node source ) {
92
- pointerArithOverflow ( source .asInstruction ( ) , _, _, _, _)
92
+ pointerArithOverflow0 ( source .asInstruction ( ) , _, _, _, _)
93
93
}
94
94
95
95
predicate isSink ( DataFlow:: Node sink ) { isInvalidPointerDerefSink1 ( sink , _, _) }
96
96
}
97
97
98
98
module PointerArithmeticToDerefFlow = DataFlow:: Global< PointerArithmeticToDerefConfig > ;
99
99
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
+
100
107
module FieldAddressToDerefConfig implements DataFlow:: StateConfigSig {
101
108
newtype FlowState =
102
109
additional TArray ( Field f ) { pointerArithOverflow ( _, f , _, _, _) } or
0 commit comments