Skip to content

Commit 49a3067

Browse files
authored
Merge pull request #18663 from github/main
Merge main into codeql-cli-2.20.4
2 parents e39ad94 + 5e92763 commit 49a3067

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ private Class getRootType(FieldAccess fa) {
4949
exists(VariableAccess root |
5050
root = fa.getQualifier+() and
5151
not exists(root.getQualifier()) and
52-
result = root.getUnspecifiedType()
52+
// We strip the type because the root may be a pointer. For example `p` in:
53+
// struct S { char buffer[10]; };
54+
// S* p = ...;
55+
// strcpy(p->buffer, "abc");
56+
result = root.getUnspecifiedType().stripType()
5357
)
5458
}
5559

java/ql/lib/semmle/code/java/security/CommandLineQuery.qll

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,15 @@ module InputToArgumentToExecFlowConfig implements DataFlow::ConfigSig {
5959
any(CommandInjectionAdditionalTaintStep s).step(n1, n2)
6060
}
6161

62-
// It's valid to use diff-informed data flow for this configuration because
63-
// the location of the selected element in the query is contained inside the
64-
// location of the sink. The query, as a predicate, is used negated in
65-
// another query, but that's only to prevent overlapping results between two
66-
// queries.
62+
// The query, as a predicate, is used negated in another query, but that's
63+
// only to prevent overlapping results between two queries.
6764
predicate observeDiffInformedIncrementalMode() { any() }
65+
66+
// All queries use the argument as the primary location and do not use the
67+
// sink as an associated location.
68+
Location getASelectedSinkLocation(DataFlow::Node sink) {
69+
exists(Expr argument | argumentToExec(argument, sink) | result = argument.getLocation())
70+
}
6871
}
6972

7073
/**

java/ql/lib/semmle/code/java/security/WebviewDebuggingEnabledQuery.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ module WebviewDebugEnabledConfig implements DataFlow::ConfigSig {
4646
}
4747

4848
predicate observeDiffInformedIncrementalMode() { any() }
49+
50+
Location getASelectedSourceLocation(DataFlow::Node source) {
51+
// This module is only used in `WebviewDebuggingEnabled.ql`, which doesn't
52+
// select the source in any "$@" column.
53+
none()
54+
}
4955
}
5056

5157
/**

0 commit comments

Comments
 (0)