@@ -198,11 +198,7 @@ private import DataFlow::GlobalWithState<InvalidPointerToDerefConfig>
198
198
199
199
/**
200
200
* Holds if `allocSource` is dataflow node that represents an allocation that flows to the
201
- * left-hand side of the pointer-arithmetic `pai`, and `derefSource <= pai + derefSourcePaiDelta`.
202
- *
203
- * For example, if `pai` is a pointer-arithmetic operation `p + size` in an expression such
204
- * as `(p + size) + 1` and `derefSource` is the node representing `(p + size) + 1`. In this
205
- * case `derefSourcePaiDelta` is 1.
201
+ * left-hand side of the pointer-arithmetic instruction represented by `derefSource`.
206
202
*/
207
203
private predicate invalidPointerToDerefSource (
208
204
DataFlow:: Node allocSource , PointerArithmeticInstruction pai , DataFlow:: Node derefSource ,
@@ -213,9 +209,8 @@ private predicate invalidPointerToDerefSource(
213
209
// `deltaDerefSourceAndPai` is the constant difference between the pointer-arithmetic instruction
214
210
// and the instruction computing the address for which we will search for a dereference.
215
211
AllocToInvalidPointer:: pointerAddInstructionHasBounds ( allocSource , pai , _, _) and
216
- // derefSource <= pai + deltaDerefSourceAndPai
217
- bounded2 ( derefSource .asInstruction ( ) , pai , deltaDerefSourceAndPai ) and
218
- deltaDerefSourceAndPai >= 0
212
+ derefSource .asInstruction ( ) = pai and
213
+ deltaDerefSourceAndPai = 0
219
214
}
220
215
221
216
/**
0 commit comments