C++: Fix Code Scanning errors.

This commit is contained in:
Mathias Vorreiter Pedersen
2023-07-18 16:27:27 +01:00
parent 4762e883fc
commit 576f021c25
4 changed files with 6 additions and 8 deletions

View File

@@ -8,8 +8,8 @@ module AllocationToInvalidPointerTest implements TestSig {
string getARelevantTag() { result = "alloc" }
predicate hasActualResult(Location location, string element, string tag, string value) {
exists(DataFlow::Node allocation, PointerAddInstruction pai, DataFlow::Node sink1, int delta |
pointerAddInstructionHasBounds(allocation, pai, sink1, delta) and
exists(DataFlow::Node allocation, PointerAddInstruction pai, int delta |
pointerAddInstructionHasBounds(allocation, pai, _, delta) and
location = pai.getLocation() and
element = pai.toString() and
tag = "alloc"

View File

@@ -48,10 +48,10 @@ module InvalidPointerToDereferenceTest implements TestSig {
predicate hasActualResult(Location location, string element, string tag, string value) {
exists(
PointerArithmeticInstruction pai, DataFlow::Node derefSource, DataFlow::Node derefSink,
DataFlow::Node operation, int delta, string value1, string value2
DataFlow::Node derefSource, DataFlow::Node derefSink, DataFlow::Node operation, int delta,
string value1, string value2
|
operationIsOffBy(_, pai, derefSource, derefSink, _, operation, delta) and
operationIsOffBy(_, _, derefSource, derefSink, _, operation, delta) and
location = operation.getLocation() and
element = operation.toString() and
tag = "deref" and