Skip to content

Commit 2862713

Browse files
committed
Merge branch 'main' into go/automated-mad-coverage-report
2 parents e300440 + 1a370bf commit 2862713

File tree

157 files changed

+447
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+447
-238
lines changed

cpp/ql/lib/CHANGELOG.md

Lines changed: 10 additions & 0 deletions

cpp/ql/lib/change-notes/2023-09-06-as-defining-argument-off-by-one-fix.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

cpp/ql/lib/change-notes/2023-09-07-return-from-end.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

cpp/ql/lib/change-notes/2023-09-08-more-unreachble.md

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions

cpp/ql/lib/codeql-pack.release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
lastReleaseVersion: 0.9.3
2+
lastReleaseVersion: 0.10.0

cpp/ql/lib/qlpack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: codeql/cpp-all
2-
version: 0.10.0-dev
2+
version: 0.10.1-dev
33
groups: cpp
44
dbscheme: semmlecode.cpp.dbscheme
55
extractor: cpp

cpp/ql/lib/semmle/code/cpp/commons/Buffer.qll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ private int isSource(Expr bufferExpr, Element why) {
7373
)
7474
}
7575

76+
/** Same as `getBufferSize`, but with the `why` column projected away to prevent large duplications. */
77+
pragma[nomagic]
78+
int getBufferSizeProj(Expr bufferExpr) { result = getBufferSize(bufferExpr, _) }
79+
7680
/**
7781
* Get the size in bytes of the buffer pointed to by an expression (if this can be determined).
7882
*/
@@ -87,15 +91,14 @@ int getBufferSize(Expr bufferExpr, Element why) {
8791
why = bufferVar and
8892
parentPtr = bufferExpr.(VariableAccess).getQualifier() and
8993
parentPtr.getTarget().getUnspecifiedType().(PointerType).getBaseType() = parentClass and
90-
result = getBufferSize(parentPtr, _) + bufferSize - parentClass.getSize()
94+
result = getBufferSizeProj(parentPtr) + bufferSize - parentClass.getSize()
9195
|
9296
if exists(bufferVar.getType().getSize())
9397
then bufferSize = bufferVar.getType().getSize()
9498
else bufferSize = 0
9599
)
96100
or
97101
// dataflow (all sources must be the same size)
98-
result = unique(Expr def | DataFlow::localExprFlowStep(def, bufferExpr) | getBufferSize(def, _)) and
99-
// find reason
102+
result = unique(Expr def | DataFlow::localExprFlowStep(def, bufferExpr) | getBufferSizeProj(def)) and
100103
exists(Expr def | DataFlow::localExprFlowStep(def, bufferExpr) | exists(getBufferSize(def, why)))
101104
}

cpp/ql/src/CHANGELOG.md

Lines changed: 13 additions & 0 deletions

cpp/ql/src/change-notes/2023-09-06-deduplicated-results.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)