Skip to content

Commit 7c6ee5f

Browse files
committed
Merge branch 'main' into unsafeHtmlConstruction
2 parents 32c4cf5 + a10b45e commit 7c6ee5f

File tree

510 files changed

+215195
-7351
lines changed

Some content is hidden

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

510 files changed

+215195
-7351
lines changed

.github/actions/fetch-codeql/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,6 @@ runs:
1919
gh extension install github/gh-codeql
2020
gh codeql set-channel "$CHANNEL"
2121
gh codeql version
22+
printf "CODEQL_FETCHED_CODEQL_PATH=" >> "${GITHUB_ENV}"
23+
gh codeql version --format=json | jq -r .unpackedLocation >> "${GITHUB_ENV}"
2224
gh codeql version --format=json | jq -r .unpackedLocation >> "${GITHUB_PATH}"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ There is [extensive documentation](https://codeql.github.com/docs/) on getting s
1010

1111
We welcome contributions to our standard library and standard checks. Do you have an idea for a new check, or how to improve an existing query? Then please go ahead and open a pull request! Before you do, though, please take the time to read our [contributing guidelines](CONTRIBUTING.md). You can also consult our [style guides](https://github.com/github/codeql/tree/main/docs) to learn how to format your code for consistency and clarity, how to write query metadata, and how to write query help documentation for your query.
1212

13+
For information on contributing to CodeQL documentation, see the "[contributing guide](docs/codeql/CONTRIBUTING.md)" for docs.
14+
1315
## License
1416

1517
The code in this repository is licensed under the [MIT License](LICENSE) by [GitHub](https://github.com).

config/identical-files.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplForContentDataFlow.qll",
3030
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl.qll",
3131
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImpl2.qll",
32+
"go/ql/lib/semmle/go/dataflow/internal/DataFlowImplForStringsNewReplacer.qll",
3233
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl.qll",
3334
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl2.qll",
3435
"python/ql/lib/semmle/python/dataflow/new/internal/DataFlowImpl3.qll",

cpp/ql/lib/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.5.1
2+
3+
No user-facing changes.
4+
15
## 0.5.0
26

37
### Breaking Changes
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.5.1
2+
3+
No user-facing changes.

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.5.0
2+
lastReleaseVersion: 0.5.1

cpp/ql/lib/experimental/semmle/code/cpp/ir/dataflow/internal/DataFlowImplConsistency.qll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,16 @@ module Consistency {
4545
) {
4646
none()
4747
}
48+
49+
/** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodeAtPosition`. */
50+
predicate uniqueParameterNodeAtPositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
51+
none()
52+
}
53+
54+
/** Holds if `(c, pos, p)` should be excluded from the consistency test `uniqueParameterNodePosition`. */
55+
predicate uniqueParameterNodePositionExclude(DataFlowCallable c, ParameterPosition pos, Node p) {
56+
none()
57+
}
4858
}
4959

5060
private class RelevantNode extends Node {
@@ -246,6 +256,7 @@ module Consistency {
246256
query predicate uniqueParameterNodeAtPosition(
247257
DataFlowCallable c, ParameterPosition pos, Node p, string msg
248258
) {
259+
not any(ConsistencyConfiguration conf).uniqueParameterNodeAtPositionExclude(c, pos, p) and
249260
isParameterNode(p, c, pos) and
250261
not exists(unique(Node p0 | isParameterNode(p0, c, pos))) and
251262
msg = "Parameters with overlapping positions."
@@ -254,6 +265,7 @@ module Consistency {
254265
query predicate uniqueParameterNodePosition(
255266
DataFlowCallable c, ParameterPosition pos, Node p, string msg
256267
) {
268+
not any(ConsistencyConfiguration conf).uniqueParameterNodePositionExclude(c, pos, p) and
257269
isParameterNode(p, c, pos) and
258270
not exists(unique(ParameterPosition pos0 | isParameterNode(p, c, pos0))) and
259271
msg = "Parameter node with multiple positions."
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
private import RangeAnalysisStage
2+
3+
module FloatDelta implements DeltaSig {
4+
class Delta = float;
5+
6+
bindingset[d]
7+
bindingset[result]
8+
float toFloat(Delta d) { result = d }
9+
10+
bindingset[d]
11+
bindingset[result]
12+
int toInt(Delta d) { result = d }
13+
14+
bindingset[n]
15+
bindingset[result]
16+
Delta fromInt(int n) { result = n }
17+
18+
bindingset[f]
19+
Delta fromFloat(float f) {
20+
result =
21+
min(float diff, float res |
22+
diff = (res - f) and res = f.ceil()
23+
or
24+
diff = (f - res) and res = f.floor()
25+
|
26+
res order by diff
27+
)
28+
}
29+
}

0 commit comments

Comments
 (0)