Skip to content

Commit 49d2e68

Browse files
committed
Merge branch 'main' into python-flask-routed-parameter
2 parents ce85ac3 + 83937ba commit 49d2e68

File tree

370 files changed

+33121
-5592
lines changed

Some content is hidden

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

370 files changed

+33121
-5592
lines changed

.github/codeql/codeql-config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ paths-ignore:
77
- '/cpp/'
88
- '/java/'
99
- '/python/'
10+
- '/javascript/ql/test'
11+
- '/javascript/extractor/tests'

change-notes/1.26/analysis-javascript.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
## General improvements
44

55
* Support for the following frameworks and libraries has been improved:
6+
- [AWS Serverless](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-resource-function.html)
7+
- [Alibaba Serverless](https://www.alibabacloud.com/help/doc-detail/156876.htm)
68
- [bluebird](https://www.npmjs.com/package/bluebird)
79
- [express](https://www.npmjs.com/package/express)
810
- [fast-json-stable-stringify](https://www.npmjs.com/package/fast-json-stable-stringify)

config/identical-files.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@
6262
"java/ql/src/semmle/code/java/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll",
6363
"csharp/ql/src/semmle/code/csharp/dataflow/internal/rangeanalysis/SignAnalysisCommon.qll"
6464
],
65+
"Bound Java/C#": [
66+
"java/ql/src/semmle/code/java/dataflow/Bound.qll",
67+
"csharp/ql/src/semmle/code/csharp/dataflow/Bound.qll"
68+
],
69+
"ModulusAnalysis Java/C#": [
70+
"java/ql/src/semmle/code/java/dataflow/ModulusAnalysis.qll",
71+
"csharp/ql/src/semmle/code/csharp/dataflow/ModulusAnalysis.qll"
72+
],
6573
"C++ SubBasicBlocks": [
6674
"cpp/ql/src/semmle/code/cpp/controlflow/SubBasicBlocks.qll",
6775
"cpp/ql/src/semmle/code/cpp/dataflow/internal/SubBasicBlocks.qll"

cpp/autobuilder/Semmle.Autobuild.Cpp.Tests/Semmle.Autobuild.Cpp.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
<TargetFramework>netcoreapp3.1</TargetFramework>
66
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
77
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
88
<Nullable>enable</Nullable>

cpp/autobuilder/Semmle.Autobuild.Cpp/Semmle.Autobuild.Cpp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.0</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
<AssemblyName>Semmle.Autobuild.Cpp</AssemblyName>
66
<RootNamespace>Semmle.Autobuild.Cpp</RootNamespace>
77
<ApplicationIcon />
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
lgtm,codescanning
2+
* The `SimpleRangeAnalysis` library has gained support for several language
3+
constructs it did not support previously. These improvements primarily affect
4+
the queries `cpp/constant-comparison`, `cpp/comparison-with-wider-type`, and
5+
`cpp/integer-multiplication-cast-to-long`. The newly supported language
6+
features are:
7+
* Multiplication of unsigned numbers.
8+
* Multiplication by a constant.
9+
* Reference-typed function parameters.
10+
* Comparing a variable not equal to an endpoint of its range, thus narrowing the range by one.
11+
* Using `if (x)` or `if (!x)` or similar to test for equality to zero.
12+
* The `SimpleRangeAnalysis` library can now be extended with custom rules. See
13+
examples in
14+
`cpp/ql/src/experimental/semmle/code/cpp/rangeanalysis/extensions/`.

cpp/ql/src/Critical/OverflowDestination.ql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ import semmle.code.cpp.security.TaintTracking
2323
* ```
2424
*/
2525
predicate sourceSized(FunctionCall fc, Expr src) {
26-
exists(string name |
27-
(name = "strncpy" or name = "strncat" or name = "memcpy" or name = "memmove") and
28-
fc.getTarget().hasGlobalOrStdName(name)
29-
) and
26+
fc.getTarget().hasGlobalOrStdName(["strncpy", "strncat", "memcpy", "memmove"]) and
3027
exists(Expr dest, Expr size, Variable v |
3128
fc.getArgument(0) = dest and
3229
fc.getArgument(1) = src and

cpp/ql/src/Critical/SizeCheck2.ql

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@
1515
import cpp
1616

1717
class Allocation extends FunctionCall {
18-
Allocation() {
19-
exists(string name |
20-
this.getTarget().hasGlobalOrStdName(name) and
21-
(name = "malloc" or name = "calloc" or name = "realloc")
22-
)
23-
}
18+
Allocation() { this.getTarget().hasGlobalOrStdName(["malloc", "calloc", "realloc"]) }
2419

2520
private string getName() { this.getTarget().hasGlobalOrStdName(result) }
2621

cpp/ql/src/JPL_C/LOC-2/Rule 11/SimpleControlFlowJmp.ql

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@
1313
import cpp
1414

1515
class ForbiddenFunction extends Function {
16-
ForbiddenFunction() {
17-
exists(string name | name = this.getName() |
18-
name = "setjmp" or
19-
name = "longjmp" or
20-
name = "sigsetjmp" or
21-
name = "siglongjmp"
22-
)
23-
}
16+
ForbiddenFunction() { this.getName() = ["setjmp", "longjmp", "sigsetjmp", "siglongjmp"] }
2417
}
2518

2619
from FunctionCall call

cpp/ql/src/Likely Bugs/Leap Year/UncheckedReturnValueForTimeFunctions.ql

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@ class DateStructModifiedFieldAccess extends LeapYearFieldAccess {
4040
*/
4141
class SafeTimeGatheringFunction extends Function {
4242
SafeTimeGatheringFunction() {
43-
this.getQualifiedName() = "GetFileTime" or
44-
this.getQualifiedName() = "GetSystemTime" or
45-
this.getQualifiedName() = "NtQuerySystemTime"
43+
this.getQualifiedName() = ["GetFileTime", "GetSystemTime", "NtQuerySystemTime"]
4644
}
4745
}
4846

@@ -51,15 +49,11 @@ class SafeTimeGatheringFunction extends Function {
5149
*/
5250
class TimeConversionFunction extends Function {
5351
TimeConversionFunction() {
54-
this.getQualifiedName() = "FileTimeToSystemTime" or
55-
this.getQualifiedName() = "SystemTimeToFileTime" or
56-
this.getQualifiedName() = "SystemTimeToTzSpecificLocalTime" or
57-
this.getQualifiedName() = "SystemTimeToTzSpecificLocalTimeEx" or
58-
this.getQualifiedName() = "TzSpecificLocalTimeToSystemTime" or
59-
this.getQualifiedName() = "TzSpecificLocalTimeToSystemTimeEx" or
60-
this.getQualifiedName() = "RtlLocalTimeToSystemTime" or
61-
this.getQualifiedName() = "RtlTimeToSecondsSince1970" or
62-
this.getQualifiedName() = "_mkgmtime"
52+
this.getQualifiedName() =
53+
["FileTimeToSystemTime", "SystemTimeToFileTime", "SystemTimeToTzSpecificLocalTime",
54+
"SystemTimeToTzSpecificLocalTimeEx", "TzSpecificLocalTimeToSystemTime",
55+
"TzSpecificLocalTimeToSystemTimeEx", "RtlLocalTimeToSystemTime",
56+
"RtlTimeToSecondsSince1970", "_mkgmtime"]
6357
}
6458
}
6559

0 commit comments

Comments
 (0)