Skip to content

Commit a8c7638

Browse files
committed
C++: Fix configuration names in comments in cpp/invalid-pointer-deref
1 parent 6ba8f9e commit a8c7638

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-193/InvalidPointerDeref.ql

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ predicate hasSize(HeuristicAllocationExpr alloc, DataFlow::Node n, int state) {
8181
* ```
8282
*
8383
* We do this by splitting the task up into two configurations:
84-
* 1. `AllocToInvalidPointerConf` find flow from `malloc(size)` to `begin + size`, and
85-
* 2. `InvalidPointerToDerefConf` finds flow from `begin + size` to an `end` (on line 3).
84+
* 1. `AllocToInvalidPointerConfig` find flow from `malloc(size)` to `begin + size`, and
85+
* 2. `InvalidPointerToDerefConfig` finds flow from `begin + size` to an `end` (on line 3).
8686
*
8787
* Finally, the range-analysis library will find a load from (or store to) an address that
8888
* is non-strictly upper-bounded by `end` (which in this case is `*p`).
@@ -180,7 +180,7 @@ predicate isSinkImpl(
180180
}
181181

182182
/**
183-
* Holds if `sink` is a sink for `InvalidPointerToDerefConf` and `i` is a `StoreInstruction` that
183+
* Holds if `sink` is a sink for `InvalidPointerToDerefConfig` and `i` is a `StoreInstruction` that
184184
* writes to an address that non-strictly upper-bounds `sink`, or `i` is a `LoadInstruction` that
185185
* reads from an address that non-strictly upper-bounds `sink`.
186186
*/
@@ -201,7 +201,7 @@ predicate isInvalidPointerDerefSink(DataFlow::Node sink, Instruction i, string o
201201

202202
/**
203203
* A configuration to track flow from a pointer-arithmetic operation found
204-
* by `AllocToInvalidPointerConf` to a dereference of the pointer.
204+
* by `AllocToInvalidPointerConfig` to a dereference of the pointer.
205205
*/
206206
module InvalidPointerToDerefConfig implements DataFlow::ConfigSig {
207207
predicate isSource(DataFlow::Node source) { invalidPointerToDerefSource(_, source, _) }
@@ -237,12 +237,12 @@ predicate invalidPointerToDerefSource(
237237
}
238238

239239
newtype TMergedPathNode =
240-
// The path nodes computed by the first projection of `AllocToInvalidPointerConf`
240+
// The path nodes computed by the first projection of `AllocToInvalidPointerConfig`
241241
TPathNode1(AllocToInvalidPointerFlow::PathNode1 p) or
242-
// The path nodes computed by `InvalidPointerToDerefConf`
242+
// The path nodes computed by `InvalidPointerToDerefConfig`
243243
TPathNode3(InvalidPointerToDerefFlow::PathNode p) or
244-
// The read/write that uses the invalid pointer identified by `InvalidPointerToDerefConf`.
245-
// This one is needed because the sink identified by `InvalidPointerToDerefConf` is the
244+
// The read/write that uses the invalid pointer identified by `InvalidPointerToDerefConfig`.
245+
// This one is needed because the sink identified by `InvalidPointerToDerefConfig` is the
246246
// pointer, but we want to raise an alert at the dereference.
247247
TPathNodeSink(Instruction i) {
248248
exists(DataFlow::Node n |
@@ -335,8 +335,8 @@ query predicate subpaths(
335335
}
336336

337337
/**
338-
* Holds if `p1` is a sink of `AllocToInvalidPointerConf` and `p2` is a source
339-
* of `InvalidPointerToDerefConf`, and they are connected through `pai`.
338+
* Holds if `p1` is a sink of `AllocToInvalidPointerConfig` and `p2` is a source
339+
* of `InvalidPointerToDerefConfig`, and they are connected through `pai`.
340340
*/
341341
predicate joinOn1(
342342
PointerArithmeticInstruction pai, AllocToInvalidPointerFlow::PathNode1 p1,
@@ -347,7 +347,7 @@ predicate joinOn1(
347347
}
348348

349349
/**
350-
* Holds if `p1` is a sink of `InvalidPointerToDerefConf` and `i` is the instruction
350+
* Holds if `p1` is a sink of `InvalidPointerToDerefConfig` and `i` is the instruction
351351
* that dereferences `p1`. The string `operation` describes whether the `i` is
352352
* a `StoreInstruction` or `LoadInstruction`.
353353
*/

0 commit comments

Comments
 (0)