Skip to content

Commit c44507c

Browse files
committed
C++: 'sizeAddend' instead of 'extra'.
1 parent 83aef6f commit c44507c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cpp/ql/lib/semmle/code/cpp/security/InvalidPointerDereference/AllocationToInvalidPointer.qll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private module Config implements ProductFlow::StateConfigSig {
172172
class FlowState2 = int;
173173

174174
predicate isSourcePair(
175-
DataFlow::Node allocSource, FlowState1 unit, DataFlow::Node sizeSource, FlowState2 extra
175+
DataFlow::Node allocSource, FlowState1 unit, DataFlow::Node sizeSource, FlowState2 sizeAddend
176176
) {
177177
// In the case of an allocation like
178178
// ```cpp
@@ -181,16 +181,16 @@ private module Config implements ProductFlow::StateConfigSig {
181181
// we use `state2` to remember that there was an offset (in this case an offset of `1`) added
182182
// to the size of the allocation. This state is then checked in `isSinkPair`.
183183
exists(unit) and
184-
hasSize(allocSource.asConvertedExpr(), sizeSource, extra)
184+
hasSize(allocSource.asConvertedExpr(), sizeSource, sizeAddend)
185185
}
186186

187187
predicate isSinkPair(
188-
DataFlow::Node allocSink, FlowState1 unit, DataFlow::Node sizeSink, FlowState2 extra
188+
DataFlow::Node allocSink, FlowState1 unit, DataFlow::Node sizeSink, FlowState2 sizeAddend
189189
) {
190190
exists(unit) and
191191
// We check that the delta computed by the range analysis matches the
192192
// state value that we set in `isSourcePair`.
193-
pointerAddInstructionHasBounds0(_, allocSink, sizeSink, extra)
193+
pointerAddInstructionHasBounds0(_, allocSink, sizeSink, sizeAddend)
194194
}
195195

196196
predicate isBarrier2(DataFlow::Node node, FlowState2 state) {

0 commit comments

Comments
 (0)