Skip to content

Commit c7c8e2f

Browse files
committed
Merge branch 'main' into promote-sqlalchemy
2 parents 97c0f1c + eaf0530 commit c7c8e2f

File tree

1,290 files changed

+83334
-11146
lines changed

Some content is hidden

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

1,290 files changed

+83334
-11146
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@
4848
*.gif -text
4949
*.dll -text
5050
*.pdb -text
51+
52+
java/ql/test/stubs/**/*.java linguist-generated=true
53+
java/ql/test/experimental/stubs/**/*.java linguist-generated=true

.github/workflows/codeql-analysis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
- 'rc/*'
1212
paths:
1313
- 'csharp/**'
14+
- '.github/codeql/**'
15+
- '.github/workflows/codeql-analysis.yml'
1416
schedule:
1517
- cron: '0 9 * * 1'
1618

@@ -38,8 +40,8 @@ jobs:
3840

3941
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
4042
# If this step fails, then you should remove it and run the build manually (see below)
41-
- name: Autobuild
42-
uses: github/codeql-action/autobuild@main
43+
#- name: Autobuild
44+
# uses: github/codeql-action/autobuild@main
4345

4446
# ℹ️ Command-line programs to run using the OS shell.
4547
# 📚 https://git.io/JvXDl
@@ -48,9 +50,8 @@ jobs:
4850
# and modify them (or add more) to build your code if your project
4951
# uses a compiled language
5052

51-
#- run: |
52-
# make bootstrap
53-
# make release
53+
- run: |
54+
dotnet build csharp
5455
5556
- name: Perform CodeQL Analysis
5657
uses: github/codeql-action/analyze@main

.github/workflows/csv-coverage-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
update:
1010
name: Update framework coverage report
11-
if: github.event.repository.fork == false
11+
if: github.repository == 'github/codeql'
1212
runs-on: ubuntu-latest
1313

1414
steps:

config/identical-files.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,4 +462,4 @@
462462
"javascript/ql/lib/semmle/javascript/security/performance/SuperlinearBackTracking.qll",
463463
"python/ql/lib/semmle/python/security/performance/SuperlinearBackTracking.qll"
464464
]
465-
}
465+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lgtm,codescanning
2+
* The `SimpleRangeAnalysis` library includes information from the
3+
immediate guard for determining the upper bound of a stack
4+
variable for improved accuracy.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
lgtm,codescanning
2+
* The `memberMayBeVarSize` predicate considers more fields to be variable size.
3+
As a result, the "Static buffer overflow" query (cpp/static-buffer-overflow)
4+
produces fewer false positives.

cpp/ql/examples/qlpack.lock.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
dependencies: {}
3+
compiled: false
4+
lockVersion: 1.0.0

cpp/ql/examples/qlpack.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
name: codeql-cpp-examples
2-
version: 0.0.0
3-
libraryPathDependencies: codeql/cpp-all
1+
name: codeql/cpp-examples
2+
version: 0.0.2
3+
dependencies:
4+
codeql/cpp-all: "*"

cpp/ql/lib/qlpack.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ version: 0.0.2
33
dbscheme: semmlecode.cpp.dbscheme
44
extractor: cpp
55
library: true
6+
dependencies:
7+
codeql/cpp-upgrades: 0.0.2

cpp/ql/lib/semmle/code/cpp/File.qll

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class Container extends Locatable, @container {
171171
* To get the full path, use `getAbsolutePath`.
172172
*/
173173
class Folder extends Container, @folder {
174-
override string getAbsolutePath() { folders(underlyingElement(this), result, _) }
174+
override string getAbsolutePath() { folders(underlyingElement(this), result) }
175175

176176
override Location getLocation() {
177177
result.getContainer() = this and
@@ -190,7 +190,7 @@ class Folder extends Container, @folder {
190190
* DEPRECATED: use `getAbsolutePath` instead.
191191
* Gets the name of this folder.
192192
*/
193-
deprecated string getName() { folders(underlyingElement(this), result, _) }
193+
deprecated string getName() { folders(underlyingElement(this), result) }
194194

195195
/**
196196
* DEPRECATED: use `getAbsolutePath` instead.
@@ -208,17 +208,7 @@ class Folder extends Container, @folder {
208208
* DEPRECATED: use `getBaseName` instead.
209209
* Gets the last part of the folder name.
210210
*/
211-
deprecated string getShortName() {
212-
exists(string longnameRaw, string longname |
213-
folders(underlyingElement(this), _, longnameRaw) and
214-
longname = longnameRaw.replaceAll("\\", "/")
215-
|
216-
exists(int index |
217-
result = longname.splitAt("/", index) and
218-
not exists(longname.splitAt("/", index + 1))
219-
)
220-
)
221-
}
211+
deprecated string getShortName() { result = this.getBaseName() }
222212

223213
/**
224214
* DEPRECATED: use `getParentContainer` instead.
@@ -242,7 +232,7 @@ class Folder extends Container, @folder {
242232
* `getStem` and `getExtension`. To get the full path, use `getAbsolutePath`.
243233
*/
244234
class File extends Container, @file {
245-
override string getAbsolutePath() { files(underlyingElement(this), result, _, _, _) }
235+
override string getAbsolutePath() { files(underlyingElement(this), result) }
246236

247237
override string toString() { result = Container.super.toString() }
248238

@@ -336,7 +326,13 @@ class File extends Container, @file {
336326
* for example, for "file.tar.gz", this predicate will have the result
337327
* "tar.gz", while `getExtension` will have the result "gz".
338328
*/
339-
string getExtensions() { files(underlyingElement(this), _, _, result, _) }
329+
string getExtensions() {
330+
exists(string name, int firstDotPos |
331+
name = this.getBaseName() and
332+
firstDotPos = min([name.indexOf("."), name.length() - 1]) and
333+
result = name.suffix(firstDotPos + 1)
334+
)
335+
}
340336

341337
/**
342338
* Gets the short name of this file, that is, the prefix of its base name up
@@ -351,7 +347,16 @@ class File extends Container, @file {
351347
* for example, for "file.tar.gz", this predicate will have the result
352348
* "file", while `getStem` will have the result "file.tar".
353349
*/
354-
string getShortName() { files(underlyingElement(this), _, result, _, _) }
350+
string getShortName() {
351+
exists(string name, int firstDotPos |
352+
name = this.getBaseName() and
353+
firstDotPos = min([name.indexOf("."), name.length()]) and
354+
result = name.prefix(firstDotPos)
355+
)
356+
or
357+
this.getAbsolutePath() = "" and
358+
result = ""
359+
}
355360
}
356361

357362
/**

0 commit comments

Comments
 (0)