Skip to content

Commit ee2d8f8

Browse files
authored
Merge branch 'main' into fix/thread-resource-arithmetic
2 parents f018d83 + 1a370bf commit ee2d8f8

File tree

381 files changed

+25017
-1065
lines changed

Some content is hidden

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

381 files changed

+25017
-1065
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@ updates:
1919
update-types: ['version-update:semver-patch', 'version-update:semver-minor']
2020

2121
- package-ecosystem: "gomod"
22-
directory: "go"
22+
directory: "go/extractor"
2323
schedule:
2424
interval: "daily"
25-
allow:
26-
- dependency-name: "golang.org/x/mod"
27-
- dependency-name: "golang.org/x/tools"
2825
reviewers:
2926
- "github/codeql-go"

config/identical-files.json

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -498,22 +498,6 @@
498498
"ruby/ql/lib/codeql/ruby/frameworks/data/internal/ApiGraphModelsExtensions.qll",
499499
"python/ql/lib/semmle/python/frameworks/data/internal/ApiGraphModelsExtensions.qll"
500500
],
501-
"TaintedFormatStringQuery Ruby/JS": [
502-
"javascript/ql/lib/semmle/javascript/security/dataflow/TaintedFormatStringQuery.qll",
503-
"ruby/ql/lib/codeql/ruby/security/TaintedFormatStringQuery.qll"
504-
],
505-
"TaintedFormatStringCustomizations Ruby/JS": [
506-
"javascript/ql/lib/semmle/javascript/security/dataflow/TaintedFormatStringCustomizations.qll",
507-
"ruby/ql/lib/codeql/ruby/security/TaintedFormatStringCustomizations.qll"
508-
],
509-
"HttpToFileAccessQuery JS/Ruby": [
510-
"javascript/ql/lib/semmle/javascript/security/dataflow/HttpToFileAccessQuery.qll",
511-
"ruby/ql/lib/codeql/ruby/security/HttpToFileAccessQuery.qll"
512-
],
513-
"HttpToFileAccessCustomizations JS/Ruby": [
514-
"javascript/ql/lib/semmle/javascript/security/dataflow/HttpToFileAccessCustomizations.qll",
515-
"ruby/ql/lib/codeql/ruby/security/HttpToFileAccessCustomizations.qll"
516-
],
517501
"Typo database": [
518502
"javascript/ql/src/Expressions/TypoDatabase.qll",
519503
"ql/ql/src/codeql_ql/style/TypoDatabase.qll"

cpp/ql/lib/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 0.10.0
2+
3+
### Minor Analysis Improvements
4+
5+
* Functions that do not return due to calling functions that don't return (e.g. `exit`) are now detected as
6+
non-returning in the IR and dataflow.
7+
* Treat functions that reach the end of the function as returning in the IR.
8+
They used to be treated as unreachable but it is allowed in C.
9+
* The `DataFlow::asDefiningArgument` predicate now takes its argument from the range starting at `1` instead of `2`. Queries that depend on the single-parameter version of `DataFlow::asDefiningArgument` should have their arguments updated accordingly.
10+
111
## 0.9.3
212

313
No user-facing changes.

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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## 0.10.0
2+
3+
### Minor Analysis Improvements
4+
5+
* Functions that do not return due to calling functions that don't return (e.g. `exit`) are now detected as
6+
non-returning in the IR and dataflow.
7+
* Treat functions that reach the end of the function as returning in the IR.
8+
They used to be treated as unreachable but it is allowed in C.
9+
* The `DataFlow::asDefiningArgument` predicate now takes its argument from the range starting at `1` instead of `2`. Queries that depend on the single-parameter version of `DataFlow::asDefiningArgument` should have their arguments updated accordingly.

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
}

0 commit comments

Comments
 (0)