Skip to content

Commit 3f18536

Browse files
author
Max Schaefer
authored
Merge pull request #669 from adityasharad/merge/master-next-111218
Merge master into next.
2 parents 9707b34 + f92456f commit 3f18536

File tree

345 files changed

+9752
-2388
lines changed

Some content is hidden

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

345 files changed

+9752
-2388
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@
4646
*.jpg -text
4747
*.jpeg -text
4848
*.gif -text
49+
*.dll -text

change-notes/1.20/analysis-cpp.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Improvements to C/C++ analysis
2+
3+
## General improvements
4+
5+
* The logic for identifying auto-generated files via `#line` directives has been improved.
6+
7+
## New queries
8+
9+
| **Query** | **Tags** | **Purpose** |
10+
|-----------------------------|-----------|--------------------------------------------------------------------|
11+
12+
## Changes to existing queries
13+
14+
| **Query** | **Expected impact** | **Change** |
15+
|----------------------------|------------------------|------------------------------------------------------------------|
16+
| Suspicious pointer scaling (`cpp/suspicious-pointer-scaling`) | Fewer false positives | False positives involving types that are not uniquely named in the snapshot have been fixed. |
17+
| Unused static variable (`cpp/unused-static-variable`) | Fewer false positive results | Variables with the attribute `unused` are now excluded from the query. |
18+
| Resource not released in destructor (`cpp/resource-not-released-in-destructor`) | Fewer false positive results | Fix false positives where a resource is released via a virtual method call. |
19+
20+
## Changes to QL libraries

change-notes/1.20/analysis-csharp.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99

1010
## Changes to existing queries
1111

12-
| *@name of query (Query ID)*| *Impact on results* | *How/why the query has changed* |
12+
| *@name of query (Query ID)* | *Impact on results* | *How/why the query has changed* |
13+
|------------------------------|------------------------|-----------------------------------|
1314
| Off-by-one comparison against container length (cs/index-out-of-bounds) | Fewer false positives | Results have been removed when there are additional guards on the index. |
15+
| Dereferenced variable is always null (cs/dereferenced-value-is-always-null) | Improved results | The query has been rewritten from scratch, and the analysis is now based on static single assignment (SSA) forms. The query is now enabled by default in LGTM. |
16+
| Dereferenced variable may be null (cs/dereferenced-value-may-be-null) | Improved results | The query has been rewritten from scratch, and the analysis is now based on static single assignment (SSA) forms. The query is now enabled by default in LGTM. |
1417

1518
## Changes to code extraction
1619

change-notes/1.20/analysis-java.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Improvements to Java analysis
2+
3+
## General improvements
4+
5+
6+
## New queries
7+
8+
| **Query** | **Tags** | **Purpose** |
9+
|-----------------------------|-----------|--------------------------------------------------------------------|
10+
| Double-checked locking is not thread-safe (`java/unsafe-double-checked-locking`) | reliability, correctness, concurrency, external/cwe/cwe-609 | Identifies wrong implementations of double-checked locking that does not use the `volatile` keyword. |
11+
| Race condition in double-checked locking object initialization (`java/unsafe-double-checked-locking-init-order`) | reliability, correctness, concurrency, external/cwe/cwe-609 | Identifies wrong implementations of double-checked locking that performs additional initialization after exposing the constructed object. |
12+
13+
## Changes to existing queries
14+
15+
| **Query** | **Expected impact** | **Change** |
16+
|----------------------------|------------------------|------------------------------------------------------------------|
17+
18+
## Changes to QL libraries
19+
20+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Improvements to JavaScript analysis
2+
3+
## General improvements
4+
5+
* Support for popular libraries has been improved. Consequently, queries may produce more results on code bases that use the following features:
6+
- client-side code, for example [React](https://reactjs.org/)
7+
- server-side code, for example [hapi](https://hapijs.com/)
8+
9+
## New queries
10+
11+
| **Query** | **Tags** | **Purpose** |
12+
|-----------------------------------------------|------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
13+
| Double escaping or unescaping (`js/double-escaping`) | correctness, security, external/cwe/cwe-116 | Highlights potential double escaping or unescaping of special characters, indicating a possible violation of [CWE-116](https://cwe.mitre.org/data/definitions/116.html). Results are shown on LGTM by default. |
14+
| Incomplete URL substring sanitization | correctness, security, external/cwe/cwe-020 | Highlights URL sanitizers that are likely to be incomplete, indicating a violation of [CWE-020](https://cwe.mitre.org/data/definitions/20.html). Results shown on LGTM by default. |
15+
| Incorrect suffix check (`js/incorrect-suffix-check`) | correctness, security, external/cwe/cwe-020 | Highlights error-prone suffix checks based on `indexOf`, indicating a potential violation of [CWE-20](https://cwe.mitre.org/data/definitions/20.html). Results are shown on LGTM by default. |
16+
| Useless comparison test (`js/useless-comparison-test`) | correctness | Highlights code that is unreachable due to a numeric comparison that is always true or always false. Results are shown on LGTM by default. |
17+
18+
## Changes to existing queries
19+
20+
| **Query** | **Expected impact** | **Change** |
21+
|--------------------------------------------|------------------------------|------------------------------------------------------------------------------|
22+
| Client-side cross-site scripting | More results | This rule now recognizes WinJS functions that are vulnerable to HTML injection. |
23+
| Unused parameter | Fewer false-positive results | This rule no longer flags parameters with leading underscore. |
24+
| Unused variable, import, function or class | Fewer false-positive results | This rule now flags fewer variables that are implictly used by JSX elements, and no longer flags variables with leading underscore. |
25+
26+
## Changes to QL libraries

cpp/ql/src/Best Practices/Unused Entities/UnusedStaticVariables.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ where v.isStatic()
2525
and not v instanceof MemberVariable
2626
and not declarationHasSideEffects(v)
2727
and not v.getAnAttribute().hasName("used")
28+
and not v.getAnAttribute().hasName("unused")
2829
select v, "Static variable " + v.getName() + " is never read"

cpp/ql/src/JPL_C/LOC-2/Rule 03/ExitNonterminatingLoop.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* @kind problem
55
* @id cpp/jpl-c/exit-nonterminating-loop
66
* @problem.severity warning
7+
* @tags correctness
8+
* external/jpl
79
*/
810

911
import cpp

cpp/ql/src/JPL_C/LOC-2/Rule 03/LoopBounds.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* @kind problem
66
* @id cpp/jpl-c/loop-bounds
77
* @problem.severity warning
8+
* @tags correctness
9+
* external/jpl
810
*/
911

1012
import cpp

cpp/ql/src/JPL_C/LOC-2/Rule 04/Recursion.ql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
* @kind problem
55
* @id cpp/jpl-c/recursion
66
* @problem.severity warning
7+
* @tags maintainability
8+
* readability
9+
* testability
10+
* external/jpl
711
*/
812

913
import cpp

cpp/ql/src/JPL_C/LOC-2/Rule 05/HeapMemory.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
* @description Dynamic memory allocation (using malloc() or calloc()) should be confined to the initialization routines of a program.
44
* @kind problem
55
* @id cpp/jpl-c/heap-memory
6-
* @problem.severity warning
6+
* @problem.severity recommendation
7+
* @tags resources
8+
* external/jpl
79
*/
810

911
import cpp

0 commit comments

Comments
 (0)