mirror of
https://github.com/github/codeql.git
synced 2026-05-16 20:27:06 +02:00
Compare commits
4 Commits
redsun82/t
...
ginsbach/O
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a11e29c01 | ||
|
|
b6ac00f642 | ||
|
|
2a187e5922 | ||
|
|
bebe3f4fe5 |
17
MODULE.bazel
17
MODULE.bazel
@@ -24,7 +24,7 @@ bazel_dep(name = "bazel_skylib", version = "1.7.1")
|
||||
bazel_dep(name = "abseil-cpp", version = "20240116.1", repo_name = "absl")
|
||||
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")
|
||||
bazel_dep(name = "fmt", version = "10.0.0")
|
||||
bazel_dep(name = "rules_kotlin", version = "2.1.3-codeql.4")
|
||||
bazel_dep(name = "rules_kotlin", version = "2.0.0-codeql.1")
|
||||
bazel_dep(name = "gazelle", version = "0.40.0")
|
||||
bazel_dep(name = "rules_dotnet", version = "0.17.4")
|
||||
bazel_dep(name = "googletest", version = "1.14.0.bcr.1")
|
||||
@@ -193,6 +193,10 @@ use_repo(
|
||||
kotlin_extractor_deps,
|
||||
"codeql_kotlin_defaults",
|
||||
"codeql_kotlin_embeddable",
|
||||
"kotlin-compiler-1.5.0",
|
||||
"kotlin-compiler-1.5.10",
|
||||
"kotlin-compiler-1.5.20",
|
||||
"kotlin-compiler-1.5.30",
|
||||
"kotlin-compiler-1.6.0",
|
||||
"kotlin-compiler-1.6.20",
|
||||
"kotlin-compiler-1.7.0",
|
||||
@@ -204,7 +208,10 @@ use_repo(
|
||||
"kotlin-compiler-2.0.20-Beta2",
|
||||
"kotlin-compiler-2.1.0-Beta1",
|
||||
"kotlin-compiler-2.1.20-Beta1",
|
||||
"kotlin-compiler-2.2.0-Beta1",
|
||||
"kotlin-compiler-embeddable-1.5.0",
|
||||
"kotlin-compiler-embeddable-1.5.10",
|
||||
"kotlin-compiler-embeddable-1.5.20",
|
||||
"kotlin-compiler-embeddable-1.5.30",
|
||||
"kotlin-compiler-embeddable-1.6.0",
|
||||
"kotlin-compiler-embeddable-1.6.20",
|
||||
"kotlin-compiler-embeddable-1.7.0",
|
||||
@@ -216,7 +223,10 @@ use_repo(
|
||||
"kotlin-compiler-embeddable-2.0.20-Beta2",
|
||||
"kotlin-compiler-embeddable-2.1.0-Beta1",
|
||||
"kotlin-compiler-embeddable-2.1.20-Beta1",
|
||||
"kotlin-compiler-embeddable-2.2.0-Beta1",
|
||||
"kotlin-stdlib-1.5.0",
|
||||
"kotlin-stdlib-1.5.10",
|
||||
"kotlin-stdlib-1.5.20",
|
||||
"kotlin-stdlib-1.5.30",
|
||||
"kotlin-stdlib-1.6.0",
|
||||
"kotlin-stdlib-1.6.20",
|
||||
"kotlin-stdlib-1.7.0",
|
||||
@@ -228,7 +238,6 @@ use_repo(
|
||||
"kotlin-stdlib-2.0.20-Beta2",
|
||||
"kotlin-stdlib-2.1.0-Beta1",
|
||||
"kotlin-stdlib-2.1.20-Beta1",
|
||||
"kotlin-stdlib-2.2.0-Beta1",
|
||||
)
|
||||
|
||||
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
ql/actions/ql/src/Security/CWE-077/EnvPathInjectionCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-077/EnvVarInjectionCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-094/CodeInjectionCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-1395/UseOfKnownVulnerableAction.ql
|
||||
ql/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql
|
||||
ql/actions/ql/src/Security/CWE-285/ImproperAccessControl.ql
|
||||
ql/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql
|
||||
ql/actions/ql/src/Security/CWE-312/SecretsInArtifacts.ql
|
||||
ql/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.ql
|
||||
ql/actions/ql/src/Security/CWE-349/CachePoisoningViaCodeInjection.ql
|
||||
ql/actions/ql/src/Security/CWE-349/CachePoisoningViaDirectCache.ql
|
||||
ql/actions/ql/src/Security/CWE-349/CachePoisoningViaPoisonableStep.ql
|
||||
ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUHigh.ql
|
||||
ql/actions/ql/src/Security/CWE-829/ArtifactPoisoningCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutHigh.ql
|
||||
@@ -1,27 +0,0 @@
|
||||
ql/actions/ql/src/Debug/SyntaxError.ql
|
||||
ql/actions/ql/src/Security/CWE-077/EnvPathInjectionCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-077/EnvPathInjectionMedium.ql
|
||||
ql/actions/ql/src/Security/CWE-077/EnvVarInjectionCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.ql
|
||||
ql/actions/ql/src/Security/CWE-094/CodeInjectionCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-094/CodeInjectionMedium.ql
|
||||
ql/actions/ql/src/Security/CWE-1395/UseOfKnownVulnerableAction.ql
|
||||
ql/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql
|
||||
ql/actions/ql/src/Security/CWE-285/ImproperAccessControl.ql
|
||||
ql/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql
|
||||
ql/actions/ql/src/Security/CWE-312/SecretsInArtifacts.ql
|
||||
ql/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.ql
|
||||
ql/actions/ql/src/Security/CWE-349/CachePoisoningViaCodeInjection.ql
|
||||
ql/actions/ql/src/Security/CWE-349/CachePoisoningViaDirectCache.ql
|
||||
ql/actions/ql/src/Security/CWE-349/CachePoisoningViaPoisonableStep.ql
|
||||
ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUHigh.ql
|
||||
ql/actions/ql/src/Security/CWE-571/ExpressionIsAlwaysTrueCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-571/ExpressionIsAlwaysTrueHigh.ql
|
||||
ql/actions/ql/src/Security/CWE-829/ArtifactPoisoningCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-829/ArtifactPoisoningMedium.ql
|
||||
ql/actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql
|
||||
ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutHigh.ql
|
||||
ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutMedium.ql
|
||||
ql/actions/ql/src/Violations Of Best Practice/CodeQL/UnnecessaryUseOfAdvancedConfig.ql
|
||||
@@ -1,23 +0,0 @@
|
||||
ql/actions/ql/src/Security/CWE-077/EnvPathInjectionCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-077/EnvPathInjectionMedium.ql
|
||||
ql/actions/ql/src/Security/CWE-077/EnvVarInjectionCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-077/EnvVarInjectionMedium.ql
|
||||
ql/actions/ql/src/Security/CWE-094/CodeInjectionCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-094/CodeInjectionMedium.ql
|
||||
ql/actions/ql/src/Security/CWE-1395/UseOfKnownVulnerableAction.ql
|
||||
ql/actions/ql/src/Security/CWE-275/MissingActionsPermissions.ql
|
||||
ql/actions/ql/src/Security/CWE-285/ImproperAccessControl.ql
|
||||
ql/actions/ql/src/Security/CWE-312/ExcessiveSecretsExposure.ql
|
||||
ql/actions/ql/src/Security/CWE-312/SecretsInArtifacts.ql
|
||||
ql/actions/ql/src/Security/CWE-312/UnmaskedSecretExposure.ql
|
||||
ql/actions/ql/src/Security/CWE-349/CachePoisoningViaCodeInjection.ql
|
||||
ql/actions/ql/src/Security/CWE-349/CachePoisoningViaDirectCache.ql
|
||||
ql/actions/ql/src/Security/CWE-349/CachePoisoningViaPoisonableStep.ql
|
||||
ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-367/UntrustedCheckoutTOCTOUHigh.ql
|
||||
ql/actions/ql/src/Security/CWE-829/ArtifactPoisoningCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-829/ArtifactPoisoningMedium.ql
|
||||
ql/actions/ql/src/Security/CWE-829/UnpinnedActionsTag.ql
|
||||
ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutCritical.ql
|
||||
ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutHigh.ql
|
||||
ql/actions/ql/src/Security/CWE-829/UntrustedCheckoutMedium.ql
|
||||
@@ -1,17 +0,0 @@
|
||||
ql/actions/ql/src/Debug/partial.ql
|
||||
ql/actions/ql/src/Models/CompositeActionsSinks.ql
|
||||
ql/actions/ql/src/Models/CompositeActionsSources.ql
|
||||
ql/actions/ql/src/Models/CompositeActionsSummaries.ql
|
||||
ql/actions/ql/src/Models/ReusableWorkflowsSinks.ql
|
||||
ql/actions/ql/src/Models/ReusableWorkflowsSources.ql
|
||||
ql/actions/ql/src/Models/ReusableWorkflowsSummaries.ql
|
||||
ql/actions/ql/src/experimental/Security/CWE-074/OutputClobberingHigh.ql
|
||||
ql/actions/ql/src/experimental/Security/CWE-078/CommandInjectionCritical.ql
|
||||
ql/actions/ql/src/experimental/Security/CWE-078/CommandInjectionMedium.ql
|
||||
ql/actions/ql/src/experimental/Security/CWE-088/ArgumentInjectionCritical.ql
|
||||
ql/actions/ql/src/experimental/Security/CWE-088/ArgumentInjectionMedium.ql
|
||||
ql/actions/ql/src/experimental/Security/CWE-200/SecretExfiltration.ql
|
||||
ql/actions/ql/src/experimental/Security/CWE-284/CodeExecutionOnSelfHostedRunner.ql
|
||||
ql/actions/ql/src/experimental/Security/CWE-829/ArtifactPoisoningPathTraversal.ql
|
||||
ql/actions/ql/src/experimental/Security/CWE-829/UnversionedImmutableAction.ql
|
||||
ql/actions/ql/src/experimental/Security/CWE-918/RequestForgery.ql
|
||||
@@ -1,14 +0,0 @@
|
||||
import runs_on
|
||||
import pytest
|
||||
from query_suites import *
|
||||
|
||||
well_known_query_suites = ['actions-code-quality.qls', 'actions-security-and-quality.qls', 'actions-security-extended.qls', 'actions-code-scanning.qls']
|
||||
|
||||
@runs_on.posix
|
||||
@pytest.mark.parametrize("query_suite", well_known_query_suites)
|
||||
def test(codeql, actions, check_query_suite, query_suite):
|
||||
check_query_suite(query_suite)
|
||||
|
||||
@runs_on.posix
|
||||
def test_not_included_queries(codeql, actions, check_queries_not_included):
|
||||
check_queries_not_included('actions', well_known_query_suites)
|
||||
@@ -1,12 +1,6 @@
|
||||
## 0.4.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 0.4.7
|
||||
|
||||
### New Features
|
||||
|
||||
* CodeQL and Copilot Autofix support for GitHub Actions is now Generally Available.
|
||||
No user-facing changes.
|
||||
|
||||
## 0.4.6
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
## 0.4.7
|
||||
|
||||
### New Features
|
||||
|
||||
* CodeQL and Copilot Autofix support for GitHub Actions is now Generally Available.
|
||||
No user-facing changes.
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
## 0.4.8
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 0.4.8
|
||||
lastReleaseVersion: 0.4.7
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/actions-all
|
||||
version: 0.4.9-dev
|
||||
version: 0.4.8-dev
|
||||
library: true
|
||||
warnOnImplicitThis: true
|
||||
dependencies:
|
||||
|
||||
@@ -1,29 +1,5 @@
|
||||
## 0.6.0
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
* The following queries have been removed from the `security-and-quality` suite.
|
||||
They are not intended to produce user-facing
|
||||
alerts describing vulnerabilities.
|
||||
Any existing alerts for these queries will be closed automatically.
|
||||
* `actions/composite-action-sinks`
|
||||
* `actions/composite-action-sources`
|
||||
* `actions/composite-action-summaries`
|
||||
* `actions/reusable-workflow-sinks`
|
||||
(renamed from `actions/reusable-wokflow-sinks`)
|
||||
* `actions/reusable-workflow-sources`
|
||||
* `actions/reusable-workflow-summaries`
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Assigned a `security-severity` to the query `actions/excessive-secrets-exposure`.
|
||||
|
||||
## 0.5.4
|
||||
|
||||
### New Features
|
||||
|
||||
* CodeQL and Copilot Autofix support for GitHub Actions is now Generally Available.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Alerts produced by the query `actions/missing-workflow-permissions` now include a minimal set of recommended permissions in the alert message, based on well-known actions seen within the workflow file.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @problem.severity warning
|
||||
* @security-severity 9.3
|
||||
* @precision high
|
||||
* @id actions/reusable-workflow-sinks
|
||||
* @id actions/reusable-wokflow-sinks
|
||||
* @tags actions
|
||||
* model-generator
|
||||
* external/cwe/cwe-020
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: fix
|
||||
---
|
||||
* Assigned a `security-severity` to the query `actions/excessive-secrets-exposure`.
|
||||
@@ -1,9 +1,5 @@
|
||||
## 0.5.4
|
||||
|
||||
### New Features
|
||||
|
||||
* CodeQL and Copilot Autofix support for GitHub Actions is now Generally Available.
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Alerts produced by the query `actions/missing-workflow-permissions` now include a minimal set of recommended permissions in the alert message, based on well-known actions seen within the workflow file.
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
## 0.6.0
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
* The following queries have been removed from the `security-and-quality` suite.
|
||||
They are not intended to produce user-facing
|
||||
alerts describing vulnerabilities.
|
||||
Any existing alerts for these queries will be closed automatically.
|
||||
* `actions/composite-action-sinks`
|
||||
* `actions/composite-action-sources`
|
||||
* `actions/composite-action-summaries`
|
||||
* `actions/reusable-workflow-sinks`
|
||||
(renamed from `actions/reusable-wokflow-sinks`)
|
||||
* `actions/reusable-workflow-sources`
|
||||
* `actions/reusable-workflow-summaries`
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Assigned a `security-severity` to the query `actions/excessive-secrets-exposure`.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 0.6.0
|
||||
lastReleaseVersion: 0.5.4
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
- queries: .
|
||||
- apply: code-quality-selectors.yml
|
||||
from: codeql/suite-helpers
|
||||
[]
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/actions-queries
|
||||
version: 0.6.1-dev
|
||||
version: 0.5.5-dev
|
||||
library: false
|
||||
warnOnImplicitThis: true
|
||||
groups: [actions, queries]
|
||||
|
||||
123
annotateOverlayLocal.py
Normal file
123
annotateOverlayLocal.py
Normal file
@@ -0,0 +1,123 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os
|
||||
|
||||
|
||||
def process_single_file(filename):
|
||||
if not filename.endswith(".qll"):
|
||||
return
|
||||
|
||||
with open(filename, 'r') as file_in:
|
||||
lines = [line for line in file_in]
|
||||
|
||||
configuresDataflow = any(
|
||||
"implements DataFlow::ConfigSig" in line for line in lines)
|
||||
|
||||
moduleAnnotations = ""
|
||||
if any(line for line in lines if line.rstrip().endswith("module;")):
|
||||
for line in lines:
|
||||
moduleAnnotations += line
|
||||
if line.rstrip().endswith("module;"):
|
||||
break
|
||||
|
||||
moduleAnnotations = strip_comments(moduleAnnotations)
|
||||
|
||||
isFileLevelAnnotated = ("overlay[local]" in moduleAnnotations or
|
||||
"overlay[local?]" in moduleAnnotations)
|
||||
|
||||
if configuresDataflow or isFileLevelAnnotated or filename.endswith("Query.qll"):
|
||||
if isFileLevelAnnotated and configuresDataflow:
|
||||
print("WARNING: file \""+filename +
|
||||
"\" configures dataflow, but is annotated local")
|
||||
elif configuresDataflow and not filename.endswith("Query.qll"):
|
||||
print("WARNING: file \""+filename +
|
||||
"\" configures dataflow but is not a [...]Query.qll file")
|
||||
elif filename.endswith("Query.qll") and not configuresDataflow:
|
||||
print("WARNING: file \""+filename +
|
||||
"\" is a [...]Query.qll file that does not configure dataflow")
|
||||
elif isFileLevelAnnotated and filename.endswith("Query.qll"):
|
||||
print("WARNING: file \""+filename +
|
||||
"\" is a [...]Query.qll file, but is annotated local")
|
||||
elif any(line for line in lines if line.rstrip().endswith("module;")):
|
||||
print("file \""+filename +
|
||||
" was annotated using an existing file-level module statment")
|
||||
with open(filename, "w") as file_out:
|
||||
for line in lines:
|
||||
if line.rstrip().endswith("module;"):
|
||||
file_out.write("overlay[local?]\n")
|
||||
file_out.write(line)
|
||||
elif (lines[0].startswith("import ") or lines[0].startswith("private ") or
|
||||
lines[0].startswith("newtype ") or lines[0].startswith("module ") or
|
||||
lines[0].startswith("signature ")):
|
||||
print("file \""+filename+" was annotated at the very start of the file")
|
||||
with open(filename, "w") as file_out:
|
||||
file_out.write("overlay[local?]\nmodule;\n\n")
|
||||
for line in lines:
|
||||
file_out.write(line)
|
||||
elif (strip_comments("".join(lines)).lstrip().startswith("import") or
|
||||
strip_comments("".join(lines)).lstrip().startswith("private import")):
|
||||
print("file \""+filename+" was annotated at the first import statement")
|
||||
with open(filename, "w") as file_out:
|
||||
firstImport = True
|
||||
addEmptyLine = ""
|
||||
for line in lines:
|
||||
if not line.strip():
|
||||
if addEmptyLine:
|
||||
file_out.write(addEmptyLine)
|
||||
addEmptyLine = line
|
||||
else:
|
||||
if firstImport and (line.startswith("import") or line.startswith("private")):
|
||||
file_out.write("overlay[local?]\nmodule;\n")
|
||||
firstImport = False
|
||||
|
||||
if addEmptyLine:
|
||||
file_out.write(addEmptyLine)
|
||||
addEmptyLine = ""
|
||||
file_out.write(line)
|
||||
elif (len(lines) > 2 and lines[0].startswith("/** ") and lines[0].endswith(" */\n") and
|
||||
not lines[1].strip() and lines[2].startswith("/**")):
|
||||
print("file \""+filename+" was annotated after single-line file module qldoc")
|
||||
with open(filename, "w") as file_out:
|
||||
file_out.write(lines[0])
|
||||
file_out.write("overlay[local?]\nmodule;\n")
|
||||
for line in lines[1:]:
|
||||
file_out.write(line)
|
||||
else:
|
||||
print("ERROR: failure to annotate file \""+filename+"\"")
|
||||
|
||||
|
||||
def strip_comments(str):
|
||||
prev = ""
|
||||
in_multiline = False
|
||||
in_singleline = False
|
||||
|
||||
result = ""
|
||||
for c in str:
|
||||
if c == '*' and prev == '/':
|
||||
in_multiline = True
|
||||
prev = ""
|
||||
elif c == '/' and prev == '/':
|
||||
in_singleline = True
|
||||
prev = ""
|
||||
elif in_multiline and c == '/' and prev == '*':
|
||||
in_multiline = False
|
||||
prev = ""
|
||||
elif in_singleline and c == '\n':
|
||||
in_singleline = False
|
||||
result += '\n'
|
||||
prev = ""
|
||||
else:
|
||||
if not in_multiline and not in_singleline:
|
||||
if prev == '/':
|
||||
result += '/'
|
||||
if c != '/':
|
||||
result += c
|
||||
prev = c
|
||||
return result
|
||||
|
||||
|
||||
for roots in ["java/ql/lib/semmle/code", "shared"]:
|
||||
for dirpath, dirnames, filenames in os.walk(roots):
|
||||
for filename in filenames:
|
||||
if filename.endswith(".qll"):
|
||||
process_single_file(os.path.join(dirpath, filename))
|
||||
@@ -1,11 +0,0 @@
|
||||
class Type extends @type {
|
||||
string toString() { none() }
|
||||
}
|
||||
|
||||
class Expr extends @expr {
|
||||
string toString() { none() }
|
||||
}
|
||||
|
||||
from Type decltype, Expr expr, Type basetype, boolean parentheses
|
||||
where decltypes(decltype, expr, _, basetype, parentheses)
|
||||
select decltype, expr, basetype, parentheses
|
||||
@@ -1,19 +0,0 @@
|
||||
class Type extends @type {
|
||||
string toString() { none() }
|
||||
}
|
||||
|
||||
predicate derivedType(Type type, string name, int kind, Type type_id) {
|
||||
derivedtypes(type, name, kind, type_id)
|
||||
}
|
||||
|
||||
predicate typeTransformation(Type type, string name, int kind, Type type_id) {
|
||||
type_operators(type, _, _, type_id) and
|
||||
name = "" and
|
||||
kind = 3 // @type_with_specifiers
|
||||
}
|
||||
|
||||
from Type type, string name, int kind, Type type_id
|
||||
where
|
||||
derivedType(type, name, kind, type_id) or
|
||||
typeTransformation(type, name, kind, type_id)
|
||||
select type, name, kind, type_id
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,5 +0,0 @@
|
||||
description: Support C23 typeof and typeof_unqual
|
||||
compatibility: backwards
|
||||
decltypes.rel: run decltypes.qlo
|
||||
derivedtypes.rel: run derivedtypes.qlo
|
||||
type_operators.rel: delete
|
||||
@@ -1,2 +0,0 @@
|
||||
#include "a.h"
|
||||
#define FOUR 4
|
||||
@@ -1,3 +0,0 @@
|
||||
int main() {
|
||||
return ONE + FOUR;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
#import "d.h"
|
||||
@@ -1,3 +0,0 @@
|
||||
int main() {
|
||||
return SEVENTEEN;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
#if 1
|
||||
#pragma hdrstop
|
||||
extern int x;
|
||||
#define SEEN_F
|
||||
#endif
|
||||
@@ -1,5 +0,0 @@
|
||||
#ifdef SEEN_F
|
||||
static int g() {
|
||||
return 20;
|
||||
}
|
||||
#endif
|
||||
@@ -1,4 +0,0 @@
|
||||
#include "h1.h"
|
||||
#pragma hdrstop
|
||||
#include "h2.h"
|
||||
#define SEEN_H
|
||||
@@ -1,17 +0,0 @@
|
||||
import os
|
||||
|
||||
|
||||
def test(codeql, cpp):
|
||||
os.mkdir("pch")
|
||||
extractor = cpp.get_tool("extractor")
|
||||
codeql.database.create(command=[
|
||||
f'"{extractor}" --mimic-clang -emit-pch -o pch/a.pch a.c',
|
||||
f'"{extractor}" --mimic-clang -include-pch pch/a.pch -Iextra_dummy_path b.c',
|
||||
f'"{extractor}" --mimic-clang -include pch/a -Iextra_dummy_path c.c',
|
||||
f'"{extractor}" --mimic-clang -emit-pch -o pch/d.pch d.c',
|
||||
f'"{extractor}" --mimic-clang -include-pch pch/d.pch e.c',
|
||||
f'"{extractor}" --mimic-clang -emit-pch -o pch/f.pch f.c',
|
||||
f'"{extractor}" --mimic-clang -include-pch pch/f.pch g.c',
|
||||
f'"{extractor}" --mimic-clang -emit-pch -o pch/h.pch h.c',
|
||||
f'"{extractor}" --mimic-clang -include-pch pch/h.pch i.c',
|
||||
])
|
||||
@@ -1 +0,0 @@
|
||||
#include "a.h"
|
||||
@@ -1,6 +0,0 @@
|
||||
#pragma hdrstop
|
||||
#include "b.h"
|
||||
|
||||
int b() {
|
||||
return A;
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#include "d.h"
|
||||
#include "c.h"
|
||||
|
||||
int c() {
|
||||
return A;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import os
|
||||
|
||||
|
||||
def test(codeql, cpp):
|
||||
os.mkdir("pch")
|
||||
extractor = cpp.get_tool("extractor")
|
||||
codeql.database.create(command=[
|
||||
f'"{extractor}" --mimic-cl /Yca.h /Fppch/a.pch a.c',
|
||||
f'"{extractor}" --mimic-cl /Yub.h /Fppch/a.pch b.c',
|
||||
f'"{extractor}" --mimic-cl /Yuc.h /Fppch/a.pch c.c',
|
||||
])
|
||||
@@ -1,60 +0,0 @@
|
||||
ql/cpp/ql/src/Critical/DoubleFree.ql
|
||||
ql/cpp/ql/src/Critical/IncorrectCheckScanf.ql
|
||||
ql/cpp/ql/src/Critical/NewFreeMismatch.ql
|
||||
ql/cpp/ql/src/Critical/OverflowStatic.ql
|
||||
ql/cpp/ql/src/Critical/UseAfterFree.ql
|
||||
ql/cpp/ql/src/Diagnostics/ExtractedFiles.ql
|
||||
ql/cpp/ql/src/Diagnostics/ExtractionWarnings.ql
|
||||
ql/cpp/ql/src/Diagnostics/FailedExtractorInvocations.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/BadAdditionOverflowCheck.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/SignedOverflowCheck.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/SnprintfOverflow.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/WrongNumberOfFormatArguments.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/AllocaInLoop.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/PointerOverflow.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToStrncat.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql
|
||||
ql/cpp/ql/src/Likely Bugs/OO/UnsafeUseOfThis.ql
|
||||
ql/cpp/ql/src/Likely Bugs/RedundantNullCheckSimple.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Underspecified Functions/TooFewArguments.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-014/MemsetMayBeDeleted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-078/ExecTainted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-079/CgiXss.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-089/SqlTainted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/BadlyBoundedWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/VeryLikelyOverrunWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-131/NoSpaceForZeroTerminator.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-134/UncontrolledFormatString.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-191/UnsignedDifferenceExpressionComparedZero.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-253/HResultBooleanConversion.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-311/CleartextFileWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-311/CleartextTransmission.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-319/UseOfHttp.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-327/OpenSslHeartbleed.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-367/TOCTOUFilesystemRace.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-416/IteratorToExpiredContainer.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-416/UseOfStringAfterLifetimeEnds.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-416/UseOfUniquePointerAfterLifetimeEnds.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-497/ExposedSystemData.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-611/XXE.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-676/DangerousFunctionOverflow.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-676/DangerousUseOfCin.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-704/WcharCharConversion.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-732/OpenCallMissingModeArgument.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.ql
|
||||
ql/cpp/ql/src/Summary/LinesOfCode.ql
|
||||
ql/cpp/ql/src/Summary/LinesOfUserCode.ql
|
||||
ql/cpp/ql/src/Telemetry/CompilerErrors.ql
|
||||
ql/cpp/ql/src/Telemetry/DatabaseQuality.ql
|
||||
ql/cpp/ql/src/Telemetry/ExtractionMetrics.ql
|
||||
ql/cpp/ql/src/Telemetry/MissingIncludes.ql
|
||||
ql/cpp/ql/src/Telemetry/SucceededIncludes.ql
|
||||
@@ -1,181 +0,0 @@
|
||||
ql/cpp/ql/src/Best Practices/BlockWithTooManyStatements.ql
|
||||
ql/cpp/ql/src/Best Practices/ComplexCondition.ql
|
||||
ql/cpp/ql/src/Best Practices/Exceptions/AccidentalRethrow.ql
|
||||
ql/cpp/ql/src/Best Practices/Exceptions/CatchingByValue.ql
|
||||
ql/cpp/ql/src/Best Practices/Exceptions/LeakyCatch.ql
|
||||
ql/cpp/ql/src/Best Practices/Exceptions/ThrowingPointers.ql
|
||||
ql/cpp/ql/src/Best Practices/GuardedFree.ql
|
||||
ql/cpp/ql/src/Best Practices/Hiding/DeclarationHidesParameter.ql
|
||||
ql/cpp/ql/src/Best Practices/Hiding/DeclarationHidesVariable.ql
|
||||
ql/cpp/ql/src/Best Practices/Hiding/LocalVariableHidesGlobalVariable.ql
|
||||
ql/cpp/ql/src/Best Practices/Likely Errors/CommaBeforeMisleadingIndentation.ql
|
||||
ql/cpp/ql/src/Best Practices/Likely Errors/EmptyBlock.ql
|
||||
ql/cpp/ql/src/Best Practices/Likely Errors/OffsetUseBeforeRangeCheck.ql
|
||||
ql/cpp/ql/src/Best Practices/Likely Errors/Slicing.ql
|
||||
ql/cpp/ql/src/Best Practices/RuleOfTwo.ql
|
||||
ql/cpp/ql/src/Best Practices/SloppyGlobal.ql
|
||||
ql/cpp/ql/src/Best Practices/SwitchLongCase.ql
|
||||
ql/cpp/ql/src/Best Practices/Unused Entities/UnusedLocals.ql
|
||||
ql/cpp/ql/src/Best Practices/Unused Entities/UnusedStaticFunctions.ql
|
||||
ql/cpp/ql/src/Best Practices/Unused Entities/UnusedStaticVariables.ql
|
||||
ql/cpp/ql/src/Best Practices/UseOfGoto.ql
|
||||
ql/cpp/ql/src/Critical/DeadCodeGoto.ql
|
||||
ql/cpp/ql/src/Critical/DoubleFree.ql
|
||||
ql/cpp/ql/src/Critical/IncorrectCheckScanf.ql
|
||||
ql/cpp/ql/src/Critical/LargeParameter.ql
|
||||
ql/cpp/ql/src/Critical/MissingCheckScanf.ql
|
||||
ql/cpp/ql/src/Critical/NewArrayDeleteMismatch.ql
|
||||
ql/cpp/ql/src/Critical/NewDeleteArrayMismatch.ql
|
||||
ql/cpp/ql/src/Critical/NewFreeMismatch.ql
|
||||
ql/cpp/ql/src/Critical/OverflowStatic.ql
|
||||
ql/cpp/ql/src/Critical/SizeCheck.ql
|
||||
ql/cpp/ql/src/Critical/SizeCheck2.ql
|
||||
ql/cpp/ql/src/Critical/UseAfterFree.ql
|
||||
ql/cpp/ql/src/Diagnostics/ExtractedFiles.ql
|
||||
ql/cpp/ql/src/Diagnostics/ExtractionWarnings.ql
|
||||
ql/cpp/ql/src/Diagnostics/FailedExtractorInvocations.ql
|
||||
ql/cpp/ql/src/Documentation/CommentedOutCode.ql
|
||||
ql/cpp/ql/src/Documentation/FixmeComments.ql
|
||||
ql/cpp/ql/src/Documentation/UncommentedFunction.ql
|
||||
ql/cpp/ql/src/Header Cleanup/Cleanup-DuplicateIncludeGuard.ql
|
||||
ql/cpp/ql/src/Likely Bugs/AmbiguouslySignedBitField.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/BadAdditionOverflowCheck.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/BadCheckOdd.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/BitwiseSignCheck.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonPrecedence.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/FloatComparison.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/PointlessComparison.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/PointlessSelfComparison.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/SignedOverflowCheck.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/UnsignedGEZero.ql
|
||||
ql/cpp/ql/src/Likely Bugs/ContinueInFalseLoop.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Conversion/ArrayArgSizeMismatch.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Conversion/ImplicitDowncastFromBitfield.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Conversion/LossyFunctionResultCast.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Conversion/LossyPointerCast.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/SnprintfOverflow.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/TooManyFormatArguments.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/WrongNumberOfFormatArguments.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql
|
||||
ql/cpp/ql/src/Likely Bugs/InconsistentCallOnResult.ql
|
||||
ql/cpp/ql/src/Likely Bugs/InconsistentCheckReturnNull.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Leap Year/Adding365DaysPerYear.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Leap Year/UncheckedReturnValueForTimeFunctions.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/AssignWhereCompareMeant.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/CompareWhereAssignMeant.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/DubiousNullCheck.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/ExprHasNoEffect.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/FutileConditional.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/MissingEnumCaseInSwitch.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/ShortCircuitBitMask.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/UsingStrcpyAsBoolean.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/inconsistentLoopDirection.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/AllocaInLoop.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/PointerOverflow.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/ReturnCstrOfLocalStdString.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/StackAddressEscapes.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToStrncat.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousSizeof.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/UnsafeUseOfStrcat.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql
|
||||
ql/cpp/ql/src/Likely Bugs/NestedLoopSameVar.ql
|
||||
ql/cpp/ql/src/Likely Bugs/OO/IncorrectConstructorDelegation.ql
|
||||
ql/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructorInBaseClass.ql
|
||||
ql/cpp/ql/src/Likely Bugs/OO/ThrowInDestructor.ql
|
||||
ql/cpp/ql/src/Likely Bugs/OO/UnsafeUseOfThis.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Protocols/TlsSettingsMisconfiguration.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Protocols/UseOfDeprecatedHardcodedProtocol.ql
|
||||
ql/cpp/ql/src/Likely Bugs/RedundantNullCheckSimple.ql
|
||||
ql/cpp/ql/src/Likely Bugs/ReturnConstType.ql
|
||||
ql/cpp/ql/src/Likely Bugs/ReturnConstTypeMember.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Underspecified Functions/ImplicitFunctionDeclaration.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Underspecified Functions/MistypedFunctionArguments.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Underspecified Functions/TooFewArguments.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Underspecified Functions/TooManyArguments.ql
|
||||
ql/cpp/ql/src/Likely Bugs/UseInOwnInitializer.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-014/MemsetMayBeDeleted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-078/ExecTainted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-079/CgiXss.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-089/SqlTainted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-114/UncontrolledProcessOperation.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-119/OverflowBuffer.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-119/OverrunWriteProductFlow.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/BadlyBoundedWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/OverrunWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/OverrunWriteFloat.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/UnboundedWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/VeryLikelyOverrunWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-121/UnterminatedVarargsCall.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-131/NoSpaceForZeroTerminator.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-134/UncontrolledFormatString.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-190/TaintedAllocationSize.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-191/UnsignedDifferenceExpressionComparedZero.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-193/InvalidPointerDeref.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-253/HResultBooleanConversion.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-290/AuthenticationBypass.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-295/SSLResultConflation.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-295/SSLResultNotChecked.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-311/CleartextBufferWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-311/CleartextFileWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-311/CleartextTransmission.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-313/CleartextSqliteDatabase.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-319/UseOfHttp.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-327/OpenSslHeartbleed.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-367/TOCTOUFilesystemRace.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-416/IteratorToExpiredContainer.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-416/UseOfStringAfterLifetimeEnds.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-416/UseOfUniquePointerAfterLifetimeEnds.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-428/UnsafeCreateProcessCall.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-468/IncorrectPointerScaling.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-468/IncorrectPointerScalingVoid.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-497/ExposedSystemData.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-497/PotentiallyExposedSystemData.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-570/IncorrectAllocationErrorHandling.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-611/XXE.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-676/DangerousFunctionOverflow.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-676/DangerousUseOfCin.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-676/PotentiallyDangerousFunction.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-704/WcharCharConversion.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-732/DoNotCreateWorldWritable.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-732/OpenCallMissingModeArgument.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-807/TaintedCondition.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-843/TypeConfusion.ql
|
||||
ql/cpp/ql/src/Summary/LinesOfCode.ql
|
||||
ql/cpp/ql/src/Summary/LinesOfUserCode.ql
|
||||
ql/cpp/ql/src/Telemetry/CompilerErrors.ql
|
||||
ql/cpp/ql/src/Telemetry/DatabaseQuality.ql
|
||||
ql/cpp/ql/src/Telemetry/ExtractionMetrics.ql
|
||||
ql/cpp/ql/src/Telemetry/MissingIncludes.ql
|
||||
ql/cpp/ql/src/Telemetry/SucceededIncludes.ql
|
||||
ql/cpp/ql/src/jsf/4.06 Pre-Processing Directives/AV Rule 32.ql
|
||||
ql/cpp/ql/src/jsf/4.07 Header Files/AV Rule 35.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.1.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 79.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 82.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 88.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 89.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 95.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 97.ql
|
||||
ql/cpp/ql/src/jsf/4.13 Functions/AV Rule 107.ql
|
||||
ql/cpp/ql/src/jsf/4.13 Functions/AV Rule 114.ql
|
||||
ql/cpp/ql/src/jsf/4.16 Initialization/AV Rule 145.ql
|
||||
ql/cpp/ql/src/jsf/4.17 Types/AV Rule 148.ql
|
||||
ql/cpp/ql/src/jsf/4.21 Operators/AV Rule 166.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 196.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 197.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 201.ql
|
||||
@@ -1,97 +0,0 @@
|
||||
ql/cpp/ql/src/Best Practices/Likely Errors/CommaBeforeMisleadingIndentation.ql
|
||||
ql/cpp/ql/src/Best Practices/Likely Errors/OffsetUseBeforeRangeCheck.ql
|
||||
ql/cpp/ql/src/Critical/DoubleFree.ql
|
||||
ql/cpp/ql/src/Critical/IncorrectCheckScanf.ql
|
||||
ql/cpp/ql/src/Critical/MissingCheckScanf.ql
|
||||
ql/cpp/ql/src/Critical/NewFreeMismatch.ql
|
||||
ql/cpp/ql/src/Critical/OverflowStatic.ql
|
||||
ql/cpp/ql/src/Critical/SizeCheck.ql
|
||||
ql/cpp/ql/src/Critical/SizeCheck2.ql
|
||||
ql/cpp/ql/src/Critical/UseAfterFree.ql
|
||||
ql/cpp/ql/src/Diagnostics/ExtractedFiles.ql
|
||||
ql/cpp/ql/src/Diagnostics/ExtractionWarnings.ql
|
||||
ql/cpp/ql/src/Diagnostics/FailedExtractorInvocations.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/BadAdditionOverflowCheck.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/SignedOverflowCheck.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Conversion/CastArrayPointerArithmetic.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/NonConstantFormat.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/SnprintfOverflow.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/WrongNumberOfFormatArguments.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Format/WrongTypeFormatArguments.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/IncorrectNotOperatorUsage.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/AllocaInLoop.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/PointerOverflow.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/StrncpyFlippedArgs.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToStrncat.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousSizeof.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/UninitializedLocal.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/UnsafeUseOfStrcat.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/UsingExpiredStackAddress.ql
|
||||
ql/cpp/ql/src/Likely Bugs/OO/UnsafeUseOfThis.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Protocols/TlsSettingsMisconfiguration.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Protocols/UseOfDeprecatedHardcodedProtocol.ql
|
||||
ql/cpp/ql/src/Likely Bugs/RedundantNullCheckSimple.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Underspecified Functions/TooFewArguments.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-014/MemsetMayBeDeleted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-022/TaintedPath.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-078/ExecTainted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-079/CgiXss.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-089/SqlTainted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-114/UncontrolledProcessOperation.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-119/OverflowBuffer.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-119/OverrunWriteProductFlow.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/BadlyBoundedWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/OverrunWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/OverrunWriteFloat.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/UnboundedWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-120/VeryLikelyOverrunWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-121/UnterminatedVarargsCall.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-131/NoSpaceForZeroTerminator.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-134/UncontrolledFormatString.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-190/ArithmeticUncontrolled.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-190/TaintedAllocationSize.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-191/UnsignedDifferenceExpressionComparedZero.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-193/InvalidPointerDeref.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-253/HResultBooleanConversion.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-290/AuthenticationBypass.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-295/SSLResultConflation.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-295/SSLResultNotChecked.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-311/CleartextBufferWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-311/CleartextFileWrite.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-311/CleartextTransmission.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-313/CleartextSqliteDatabase.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-319/UseOfHttp.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-326/InsufficientKeySize.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-327/BrokenCryptoAlgorithm.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-327/OpenSslHeartbleed.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-367/TOCTOUFilesystemRace.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-416/IteratorToExpiredContainer.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-416/UseOfStringAfterLifetimeEnds.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-416/UseOfUniquePointerAfterLifetimeEnds.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-428/UnsafeCreateProcessCall.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-468/IncorrectPointerScaling.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-468/IncorrectPointerScalingVoid.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-468/SuspiciousAddWithSizeof.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-497/ExposedSystemData.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-497/PotentiallyExposedSystemData.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-570/IncorrectAllocationErrorHandling.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-611/XXE.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-676/DangerousFunctionOverflow.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-676/DangerousUseOfCin.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-676/PotentiallyDangerousFunction.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-704/WcharCharConversion.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-732/DoNotCreateWorldWritable.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-732/OpenCallMissingModeArgument.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-732/UnsafeDaclSecurityDescriptor.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-807/TaintedCondition.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-843/TypeConfusion.ql
|
||||
ql/cpp/ql/src/Summary/LinesOfCode.ql
|
||||
ql/cpp/ql/src/Summary/LinesOfUserCode.ql
|
||||
ql/cpp/ql/src/Telemetry/CompilerErrors.ql
|
||||
ql/cpp/ql/src/Telemetry/DatabaseQuality.ql
|
||||
ql/cpp/ql/src/Telemetry/ExtractionMetrics.ql
|
||||
ql/cpp/ql/src/Telemetry/MissingIncludes.ql
|
||||
ql/cpp/ql/src/Telemetry/SucceededIncludes.ql
|
||||
@@ -1,447 +0,0 @@
|
||||
ql/cpp/ql/src/AlertSuppression.ql
|
||||
ql/cpp/ql/src/Architecture/FeatureEnvy.ql
|
||||
ql/cpp/ql/src/Architecture/General Class-Level Information/ClassHierarchies.ql
|
||||
ql/cpp/ql/src/Architecture/General Class-Level Information/HubClasses.ql
|
||||
ql/cpp/ql/src/Architecture/General Class-Level Information/InheritanceDepthDistribution.ql
|
||||
ql/cpp/ql/src/Architecture/General Namespace-Level Information/CyclicNamespaces.ql
|
||||
ql/cpp/ql/src/Architecture/General Namespace-Level Information/GlobalNamespaceClasses.ql
|
||||
ql/cpp/ql/src/Architecture/General Namespace-Level Information/NamespaceDependencies.ql
|
||||
ql/cpp/ql/src/Architecture/General Top-Level Information/GeneralStatistics.ql
|
||||
ql/cpp/ql/src/Architecture/InappropriateIntimacy.ql
|
||||
ql/cpp/ql/src/Architecture/Refactoring Opportunities/ClassesWithManyDependencies.ql
|
||||
ql/cpp/ql/src/Architecture/Refactoring Opportunities/ClassesWithManyFields.ql
|
||||
ql/cpp/ql/src/Architecture/Refactoring Opportunities/ComplexFunctions.ql
|
||||
ql/cpp/ql/src/Architecture/Refactoring Opportunities/CyclomaticComplexity.ql
|
||||
ql/cpp/ql/src/Architecture/Refactoring Opportunities/FunctionsWithManyParameters.ql
|
||||
ql/cpp/ql/src/Best Practices/Magic Constants/JapaneseEraDate.ql
|
||||
ql/cpp/ql/src/Best Practices/Magic Constants/MagicConstantsNumbers.ql
|
||||
ql/cpp/ql/src/Best Practices/Magic Constants/MagicConstantsString.ql
|
||||
ql/cpp/ql/src/Best Practices/Magic Constants/MagicNumbersUseConstant.ql
|
||||
ql/cpp/ql/src/Best Practices/Magic Constants/MagicStringsUseConstant.ql
|
||||
ql/cpp/ql/src/Best Practices/NVI.ql
|
||||
ql/cpp/ql/src/Best Practices/NVIHub.ql
|
||||
ql/cpp/ql/src/Best Practices/RuleOfThree.ql
|
||||
ql/cpp/ql/src/Best Practices/Unused Entities/UnusedIncludes.ql
|
||||
ql/cpp/ql/src/Critical/DeadCodeCondition.ql
|
||||
ql/cpp/ql/src/Critical/DeadCodeFunction.ql
|
||||
ql/cpp/ql/src/Critical/DescriptorMayNotBeClosed.ql
|
||||
ql/cpp/ql/src/Critical/DescriptorNeverClosed.ql
|
||||
ql/cpp/ql/src/Critical/FileMayNotBeClosed.ql
|
||||
ql/cpp/ql/src/Critical/FileNeverClosed.ql
|
||||
ql/cpp/ql/src/Critical/GlobalUseBeforeInit.ql
|
||||
ql/cpp/ql/src/Critical/InconsistentNullnessTesting.ql
|
||||
ql/cpp/ql/src/Critical/InitialisationNotRun.ql
|
||||
ql/cpp/ql/src/Critical/LateNegativeTest.ql
|
||||
ql/cpp/ql/src/Critical/MemoryMayNotBeFreed.ql
|
||||
ql/cpp/ql/src/Critical/MemoryNeverFreed.ql
|
||||
ql/cpp/ql/src/Critical/MissingNegativityTest.ql
|
||||
ql/cpp/ql/src/Critical/MissingNullTest.ql
|
||||
ql/cpp/ql/src/Critical/NotInitialised.ql
|
||||
ql/cpp/ql/src/Critical/OverflowCalculated.ql
|
||||
ql/cpp/ql/src/Critical/OverflowDestination.ql
|
||||
ql/cpp/ql/src/Critical/ReturnStackAllocatedObject.ql
|
||||
ql/cpp/ql/src/Critical/ReturnValueIgnored.ql
|
||||
ql/cpp/ql/src/Critical/Unused.ql
|
||||
ql/cpp/ql/src/Diagnostics/Internal/ExtractionErrors.ql
|
||||
ql/cpp/ql/src/Documentation/DocumentApi.ql
|
||||
ql/cpp/ql/src/Documentation/TodoComments.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 03/ExitNonterminatingLoop.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 03/LoopBounds.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 04/Recursion.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 05/HeapMemory.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 07/ThreadSafety.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 09/AvoidNestedSemaphores.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 09/AvoidSemaphores.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 09/OutOfOrderLocks.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 09/ReleaseLocksWhenAcquired.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 11/SimpleControlFlowGoto.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 11/SimpleControlFlowJmp.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-2/Rule 12/EnumInitialization.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 13/ExternDeclsInHeader.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 13/LimitedScopeFile.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 13/LimitedScopeFunction.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 13/LimitedScopeLocalHidesGlobal.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 14/CheckingReturnValues.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 15/CheckingParameterValues.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 16/UseOfAssertionsConstant.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 16/UseOfAssertionsDensity.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 16/UseOfAssertionsNonBoolean.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 16/UseOfAssertionsSideEffect.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 17/BasicIntTypes.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 18/CompoundExpressions.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-3/Rule 19/NoBooleanSideEffects.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 20/PreprocessorUse.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 20/PreprocessorUseIfdef.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 20/PreprocessorUsePartial.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 20/PreprocessorUseUndisciplined.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 21/MacroInBlock.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 22/UseOfUndef.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 23/MismatchedIfdefs.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 24/MultipleStmtsPerLine.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 24/MultipleVarDeclsPerLine.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 25/FunctionSizeLimits.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 26/DeclarationPointerNesting.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 27/PointerDereferenceInStmt.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 28/HiddenPointerDereferenceMacro.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 28/HiddenPointerIndirectionTypedef.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 29/NonConstFunctionPointer.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 30/FunctionPointerConversions.ql
|
||||
ql/cpp/ql/src/JPL_C/LOC-4/Rule 31/IncludesFirst.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Arithmetic/ComparisonWithCancelingSubExpr.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Conversion/ConversionChangesSign.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Conversion/NonzeroValueCastToPointer.ql
|
||||
ql/cpp/ql/src/Likely Bugs/JapaneseEra/ConstructorOrMethodWithExactEraDate.ql
|
||||
ql/cpp/ql/src/Likely Bugs/JapaneseEra/StructWithExactEraDate.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Leap Year/UnsafeArrayForDaysOfYear.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/BoolValueInBitOp.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Likely Typos/LogicalExprCouldBeSimplified.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/ImproperNullTermination.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/NtohlArrayNoBound.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/Padding/More64BitWaste.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/Padding/NonPortablePrintf.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/Padding/Suboptimal64BitType.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/PotentialBufferOverflow.ql
|
||||
ql/cpp/ql/src/Likely Bugs/Memory Management/SuspiciousCallToMemset.ql
|
||||
ql/cpp/ql/src/Likely Bugs/OO/NonVirtualDestructor.ql
|
||||
ql/cpp/ql/src/Likely Bugs/OO/SelfAssignmentCheck.ql
|
||||
ql/cpp/ql/src/Likely Bugs/OO/VirtualCallInStructor.ql
|
||||
ql/cpp/ql/src/Likely Bugs/ShortLoopVarName.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CAfferentCoupling.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CEfferentCoupling.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CHalsteadBugs.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CHalsteadDifficulty.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CHalsteadEffort.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CHalsteadLength.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CHalsteadVocabulary.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CHalsteadVolume.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CInheritanceDepth.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CLackOfCohesionCK.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CLackOfCohesionHS.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CLinesOfCode.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CNumberOfFields.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CNumberOfFunctions.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CNumberOfStatements.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CPercentageOfComplexCode.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CResponse.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CSizeOfAPI.ql
|
||||
ql/cpp/ql/src/Metrics/Classes/CSpecialisation.ql
|
||||
ql/cpp/ql/src/Metrics/Dependencies/ExternalDependencies.ql
|
||||
ql/cpp/ql/src/Metrics/Dependencies/ExternalDependenciesSourceLinks.ql
|
||||
ql/cpp/ql/src/Metrics/External/FileCompilationDisplayStrings.ql
|
||||
ql/cpp/ql/src/Metrics/External/FileCompilationSourceLinks.ql
|
||||
ql/cpp/ql/src/Metrics/Files/AutogeneratedLOC.ql
|
||||
ql/cpp/ql/src/Metrics/Files/ConditionalSegmentConditions.ql
|
||||
ql/cpp/ql/src/Metrics/Files/ConditionalSegmentLines.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FAfferentCoupling.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FCommentRatio.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FCyclomaticComplexity.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FDirectIncludes.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FEfferentCoupling.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FHalsteadBugs.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FHalsteadDifficulty.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FHalsteadEffort.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FHalsteadLength.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FHalsteadVocabulary.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FHalsteadVolume.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FLines.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FLinesOfCode.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FLinesOfCommentedOutCode.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FLinesOfComments.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FMacroRatio.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FNumberOfClasses.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FNumberOfTests.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FTimeInFrontend.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FTodoComments.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FTransitiveIncludes.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FTransitiveSourceIncludes.ql
|
||||
ql/cpp/ql/src/Metrics/Files/FunctionLength.ql
|
||||
ql/cpp/ql/src/Metrics/Files/NumberOfFunctions.ql
|
||||
ql/cpp/ql/src/Metrics/Files/NumberOfGlobals.ql
|
||||
ql/cpp/ql/src/Metrics/Files/NumberOfParameters.ql
|
||||
ql/cpp/ql/src/Metrics/Files/NumberOfPublicFunctions.ql
|
||||
ql/cpp/ql/src/Metrics/Files/NumberOfPublicGlobals.ql
|
||||
ql/cpp/ql/src/Metrics/Functions/FunCyclomaticComplexity.ql
|
||||
ql/cpp/ql/src/Metrics/Functions/FunIterationNestingDepth.ql
|
||||
ql/cpp/ql/src/Metrics/Functions/FunLinesOfCode.ql
|
||||
ql/cpp/ql/src/Metrics/Functions/FunLinesOfComments.ql
|
||||
ql/cpp/ql/src/Metrics/Functions/FunNumberOfCalls.ql
|
||||
ql/cpp/ql/src/Metrics/Functions/FunNumberOfParameters.ql
|
||||
ql/cpp/ql/src/Metrics/Functions/FunNumberOfStatements.ql
|
||||
ql/cpp/ql/src/Metrics/Functions/FunPercentageOfComments.ql
|
||||
ql/cpp/ql/src/Metrics/Functions/StatementNestingDepth.ql
|
||||
ql/cpp/ql/src/Metrics/Internal/ASTConsistency.ql
|
||||
ql/cpp/ql/src/Metrics/Internal/CallableDisplayStrings.ql
|
||||
ql/cpp/ql/src/Metrics/Internal/CallableExtents.ql
|
||||
ql/cpp/ql/src/Metrics/Internal/CallableSourceLinks.ql
|
||||
ql/cpp/ql/src/Metrics/Internal/DiagnosticsSumElapsedTimes.ql
|
||||
ql/cpp/ql/src/Metrics/Internal/IRConsistency.ql
|
||||
ql/cpp/ql/src/Metrics/Internal/IncludeResolutionStatus.ql
|
||||
ql/cpp/ql/src/Metrics/Internal/ReftypeDisplayStrings.ql
|
||||
ql/cpp/ql/src/Metrics/Internal/ReftypeSourceLinks.ql
|
||||
ql/cpp/ql/src/Metrics/Namespaces/AbstractNamespaces.ql
|
||||
ql/cpp/ql/src/Metrics/Namespaces/ConcreteNamespaces.ql
|
||||
ql/cpp/ql/src/Metrics/Namespaces/HighAfferentCouplingNamespaces.ql
|
||||
ql/cpp/ql/src/Metrics/Namespaces/HighDistanceFromMainLineNamespaces.ql
|
||||
ql/cpp/ql/src/Metrics/Namespaces/HighEfferentCouplingNamespaces.ql
|
||||
ql/cpp/ql/src/Metrics/Namespaces/StableNamespaces.ql
|
||||
ql/cpp/ql/src/Metrics/Namespaces/UnstableNamespaces.ql
|
||||
ql/cpp/ql/src/Microsoft/CallWithNullSAL.ql
|
||||
ql/cpp/ql/src/Microsoft/IgnoreReturnValueSAL.ql
|
||||
ql/cpp/ql/src/Microsoft/InconsistentSAL.ql
|
||||
ql/cpp/ql/src/PointsTo/Debug.ql
|
||||
ql/cpp/ql/src/PointsTo/PreparedStagedPointsTo.ql
|
||||
ql/cpp/ql/src/PointsTo/Stats.ql
|
||||
ql/cpp/ql/src/PointsTo/TaintedFormatStrings.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 1/UseOfGoto.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 1/UseOfJmp.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 1/UseOfRecursion.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 2/BoundedLoopIterations.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 2/ExitPermanentLoop.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 3/DynamicAllocAfterInit.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 4/FunctionTooLong.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 4/OneStmtPerLine.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 5/AssertionDensity.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 5/AssertionSideEffect.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 5/ConstantAssertion.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 5/NonBooleanAssertion.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 6/GlobalCouldBeStatic.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 6/VariableScopeTooLarge.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 7/CheckArguments.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 7/CheckReturnValues.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 8/AvoidConditionalCompilation.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 8/PartialMacro.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 8/RestrictPreprocessor.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 8/UndisciplinedMacro.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 9/FunctionPointer.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 9/HiddenPointerIndirection.ql
|
||||
ql/cpp/ql/src/Power of 10/Rule 9/PointerNesting.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-020/CountUntrustedDataToExternalAPI.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-020/IRCountUntrustedDataToExternalAPI.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-020/IRUntrustedDataToExternalAPI.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-020/UntrustedDataToExternalAPI.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-129/ImproperArrayIndexValidation.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-170/ImproperNullTerminationTainted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-190/ArithmeticTainted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-190/ArithmeticWithExtremeValues.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-190/IntegerOverflowTainted.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-457/ConditionallyUninitializedVariable.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-468/IncorrectPointerScalingChar.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-764/LockOrderCycle.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-764/TwiceLocked.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-764/UnreleasedLock.ql
|
||||
ql/cpp/ql/src/Security/CWE/CWE-835/InfiniteLoopWithUnsatisfiableExitCondition.ql
|
||||
ql/cpp/ql/src/definitions.ql
|
||||
ql/cpp/ql/src/experimental/Best Practices/UselessTest.ql
|
||||
ql/cpp/ql/src/experimental/Best Practices/WrongUintAccess.ql
|
||||
ql/cpp/ql/src/experimental/Likely Bugs/ArrayAccessProductFlow.ql
|
||||
ql/cpp/ql/src/experimental/Likely Bugs/DerefNullResult.ql
|
||||
ql/cpp/ql/src/experimental/Likely Bugs/RedundantNullCheckParam.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-020/LateCheckOfFunctionArgument.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-020/NoCheckBeforeUnsafePutUser.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-078/WordexpTainted.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-1041/FindWrapperFunctions.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-1126/DeclarationOfVariableWithUnnecessarilyWideScope.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-120/MemoryUnsafeFunctionScan.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-1240/CustomCryptographicPrimitive.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-125/DangerousWorksWithMultibyteOrWideCharacters.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-190/AllocMultiplicationOverflow.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-190/DangerousUseOfTransformationAfterOperation.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-190/IfStatementAdditionOverflow.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-193/ConstantSizeArrayOffByOne.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-200/ExposureSensitiveInformationUnauthorizedActor.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-243/IncorrectChangingWorkingDirectory.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-266/IncorrectPrivilegeAssignment.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-273/PrivilegeDroppingOutoforder.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-285/PamAuthorization.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-295/CurlSSL.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-359/PrivateCleartextWrite.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-362/double-fetch.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-369/DivideByZeroUsingReturnValue.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-377/InsecureTemporaryFile.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-401/MemoryLeakOnFailedCallToRealloc.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-409/DecompressionBombs.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-415/DoubleFree.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-416/UseAfterExpiredLifetime.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-476/DangerousUseOfExceptionBlocks.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-561/FindIncorrectlyUsedSwitch.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-670/DangerousUseSSL_shutdown.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-675/DoubleRelease.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-691/InsufficientControlFlowManagementAfterRefactoringTheCode.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-691/InsufficientControlFlowManagementWhenUsingBitOperations.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-703/FindIncorrectlyUsedExceptions.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-754/ImproperCheckReturnValueScanf.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-758/UndefinedOrImplementationDefinedBehavior.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-783/OperatorPrecedenceLogicErrorWhenUseBitwiseOrLogicalOperations.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-783/OperatorPrecedenceLogicErrorWhenUseBoolType.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-787/UnsignedToSignedPointerArith.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-788/AccessOfMemoryLocationAfterEndOfBufferUsingStrlen.ql
|
||||
ql/cpp/ql/src/experimental/Security/CWE/CWE-805/BufferAccessWithIncorrectLengthValue.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/example_alerts/UnknownAsymmetricKeyGen.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/example_alerts/WeakAsymmetricKeyGen.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/example_alerts/WeakBlockMode.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/example_alerts/WeakEllipticCurve.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/example_alerts/WeakEncryption.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/example_alerts/WeakHashes.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/AllAsymmetricAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/AllCryptoAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/AsymmetricEncryptionAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/AsymmetricPaddingAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/AuthenticatedEncryptionAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/BlockModeAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/BlockModeKnownIVsOrNonces.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/BlockModeUnknownIVsOrNonces.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/EllipticCurveAlgorithmSize.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/EllipticCurveAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/HashingAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/KeyExchangeAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/KnownAsymmetricKeyGeneration.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/SigningAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/SymmetricEncryptionAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/SymmetricPaddingAlgorithms.ql
|
||||
ql/cpp/ql/src/experimental/cryptography/inventory/new_models/UnknownAsymmetricKeyGeneration.ql
|
||||
ql/cpp/ql/src/external/examples/filters/BumpMetricBy10.ql
|
||||
ql/cpp/ql/src/external/examples/filters/EditDefectMessage.ql
|
||||
ql/cpp/ql/src/external/examples/filters/ExcludeGeneratedCode.ql
|
||||
ql/cpp/ql/src/filters/ClassifyFiles.ql
|
||||
ql/cpp/ql/src/jsf/3.02 Code Size and Complexity/AV Rule 1.ql
|
||||
ql/cpp/ql/src/jsf/3.02 Code Size and Complexity/AV Rule 2.ql
|
||||
ql/cpp/ql/src/jsf/3.02 Code Size and Complexity/AV Rule 3.ql
|
||||
ql/cpp/ql/src/jsf/4.04 Environment/AV Rule 11.ql
|
||||
ql/cpp/ql/src/jsf/4.04 Environment/AV Rule 12.ql
|
||||
ql/cpp/ql/src/jsf/4.04 Environment/AV Rule 13.ql
|
||||
ql/cpp/ql/src/jsf/4.04 Environment/AV Rule 14.ql
|
||||
ql/cpp/ql/src/jsf/4.04 Environment/AV Rule 9.ql
|
||||
ql/cpp/ql/src/jsf/4.05 Libraries/AV Rule 17.ql
|
||||
ql/cpp/ql/src/jsf/4.05 Libraries/AV Rule 18.ql
|
||||
ql/cpp/ql/src/jsf/4.05 Libraries/AV Rule 19.ql
|
||||
ql/cpp/ql/src/jsf/4.05 Libraries/AV Rule 20.ql
|
||||
ql/cpp/ql/src/jsf/4.05 Libraries/AV Rule 21.ql
|
||||
ql/cpp/ql/src/jsf/4.05 Libraries/AV Rule 22.ql
|
||||
ql/cpp/ql/src/jsf/4.05 Libraries/AV Rule 23.ql
|
||||
ql/cpp/ql/src/jsf/4.05 Libraries/AV Rule 24.ql
|
||||
ql/cpp/ql/src/jsf/4.05 Libraries/AV Rule 25.ql
|
||||
ql/cpp/ql/src/jsf/4.06 Pre-Processing Directives/AV Rule 26.ql
|
||||
ql/cpp/ql/src/jsf/4.06 Pre-Processing Directives/AV Rule 27.ql
|
||||
ql/cpp/ql/src/jsf/4.06 Pre-Processing Directives/AV Rule 28.ql
|
||||
ql/cpp/ql/src/jsf/4.06 Pre-Processing Directives/AV Rule 29.ql
|
||||
ql/cpp/ql/src/jsf/4.06 Pre-Processing Directives/AV Rule 30.ql
|
||||
ql/cpp/ql/src/jsf/4.06 Pre-Processing Directives/AV Rule 31.ql
|
||||
ql/cpp/ql/src/jsf/4.07 Header Files/AV Rule 33.ql
|
||||
ql/cpp/ql/src/jsf/4.07 Header Files/AV Rule 39.ql
|
||||
ql/cpp/ql/src/jsf/4.08 Implementation Files/AV Rule 40.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 41.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 42.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 43.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 44.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 45.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 46.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 47.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 48.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 49.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 50.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 51.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 52.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 53.1.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 53.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 54.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 57.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 58.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 59.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 60.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 61.ql
|
||||
ql/cpp/ql/src/jsf/4.09 Style/AV Rule 63.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 68.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 69.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 70.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 71.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 73.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 74.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 75.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 76.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 77.1.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 78.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 81.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 85.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 88.1.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 94.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 96.ql
|
||||
ql/cpp/ql/src/jsf/4.10 Classes/AV Rule 97.1.ql
|
||||
ql/cpp/ql/src/jsf/4.11 Namespaces/AV Rule 99.ql
|
||||
ql/cpp/ql/src/jsf/4.12 Templates/AV Rule 104.ql
|
||||
ql/cpp/ql/src/jsf/4.13 Functions/AV Rule 108.ql
|
||||
ql/cpp/ql/src/jsf/4.13 Functions/AV Rule 110.ql
|
||||
ql/cpp/ql/src/jsf/4.13 Functions/AV Rule 111.ql
|
||||
ql/cpp/ql/src/jsf/4.13 Functions/AV Rule 113.ql
|
||||
ql/cpp/ql/src/jsf/4.13 Functions/AV Rule 115.ql
|
||||
ql/cpp/ql/src/jsf/4.13 Functions/AV Rule 119.ql
|
||||
ql/cpp/ql/src/jsf/4.14 Comments/AV Rule 126.ql
|
||||
ql/cpp/ql/src/jsf/4.14 Comments/AV Rule 127.ql
|
||||
ql/cpp/ql/src/jsf/4.14 Comments/AV Rule 133.ql
|
||||
ql/cpp/ql/src/jsf/4.15 Declarations and Definitions/AV Rule 135.ql
|
||||
ql/cpp/ql/src/jsf/4.15 Declarations and Definitions/AV Rule 138.ql
|
||||
ql/cpp/ql/src/jsf/4.15 Declarations and Definitions/AV Rule 139.ql
|
||||
ql/cpp/ql/src/jsf/4.15 Declarations and Definitions/AV Rule 140.ql
|
||||
ql/cpp/ql/src/jsf/4.16 Initialization/AV Rule 142.ql
|
||||
ql/cpp/ql/src/jsf/4.16 Initialization/AV Rule 143.ql
|
||||
ql/cpp/ql/src/jsf/4.17 Types/AV Rule 147.ql
|
||||
ql/cpp/ql/src/jsf/4.18 Constants/AV Rule 149.ql
|
||||
ql/cpp/ql/src/jsf/4.18 Constants/AV Rule 150.ql
|
||||
ql/cpp/ql/src/jsf/4.18 Constants/AV Rule 151.1.ql
|
||||
ql/cpp/ql/src/jsf/4.18 Constants/AV Rule 151.ql
|
||||
ql/cpp/ql/src/jsf/4.19 Variables/AV Rule 152.ql
|
||||
ql/cpp/ql/src/jsf/4.20 Unions and Bit Fields/AV Rule 153.ql
|
||||
ql/cpp/ql/src/jsf/4.20 Unions and Bit Fields/AV Rule 154.ql
|
||||
ql/cpp/ql/src/jsf/4.20 Unions and Bit Fields/AV Rule 155.ql
|
||||
ql/cpp/ql/src/jsf/4.20 Unions and Bit Fields/AV Rule 156.ql
|
||||
ql/cpp/ql/src/jsf/4.21 Operators/AV Rule 157.ql
|
||||
ql/cpp/ql/src/jsf/4.21 Operators/AV Rule 158.ql
|
||||
ql/cpp/ql/src/jsf/4.21 Operators/AV Rule 159.ql
|
||||
ql/cpp/ql/src/jsf/4.21 Operators/AV Rule 160.ql
|
||||
ql/cpp/ql/src/jsf/4.21 Operators/AV Rule 162.ql
|
||||
ql/cpp/ql/src/jsf/4.21 Operators/AV Rule 163.ql
|
||||
ql/cpp/ql/src/jsf/4.21 Operators/AV Rule 164.ql
|
||||
ql/cpp/ql/src/jsf/4.21 Operators/AV Rule 165.ql
|
||||
ql/cpp/ql/src/jsf/4.21 Operators/AV Rule 168.ql
|
||||
ql/cpp/ql/src/jsf/4.22 Pointers and References/AV Rule 170.ql
|
||||
ql/cpp/ql/src/jsf/4.22 Pointers and References/AV Rule 171.ql
|
||||
ql/cpp/ql/src/jsf/4.22 Pointers and References/AV Rule 173.ql
|
||||
ql/cpp/ql/src/jsf/4.22 Pointers and References/AV Rule 175.ql
|
||||
ql/cpp/ql/src/jsf/4.22 Pointers and References/AV Rule 176.ql
|
||||
ql/cpp/ql/src/jsf/4.23 Type Conversions/AV Rule 178.ql
|
||||
ql/cpp/ql/src/jsf/4.23 Type Conversions/AV Rule 179.ql
|
||||
ql/cpp/ql/src/jsf/4.23 Type Conversions/AV Rule 180.ql
|
||||
ql/cpp/ql/src/jsf/4.23 Type Conversions/AV Rule 181.ql
|
||||
ql/cpp/ql/src/jsf/4.23 Type Conversions/AV Rule 182.ql
|
||||
ql/cpp/ql/src/jsf/4.23 Type Conversions/AV Rule 184.ql
|
||||
ql/cpp/ql/src/jsf/4.23 Type Conversions/AV Rule 185.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 186.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 187.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 188.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 189.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 190.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 191.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 192.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 193.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 194.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 195.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 198.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 199.ql
|
||||
ql/cpp/ql/src/jsf/4.24 Control Flow Structures/AV Rule 200.ql
|
||||
ql/cpp/ql/src/jsf/4.25 Expressions/AV Rule 202.ql
|
||||
ql/cpp/ql/src/jsf/4.25 Expressions/AV Rule 204.1.ql
|
||||
ql/cpp/ql/src/jsf/4.25 Expressions/AV Rule 204.ql
|
||||
ql/cpp/ql/src/jsf/4.25 Expressions/AV Rule 205.ql
|
||||
ql/cpp/ql/src/jsf/4.26 Memory Allocation/AV Rule 206.ql
|
||||
ql/cpp/ql/src/jsf/4.26 Memory Allocation/AV Rule 207.ql
|
||||
ql/cpp/ql/src/jsf/4.27 Fault Handling/AV Rule 208.ql
|
||||
ql/cpp/ql/src/jsf/4.28 Portable Code/AV Rule 209.ql
|
||||
ql/cpp/ql/src/jsf/4.28 Portable Code/AV Rule 210.ql
|
||||
ql/cpp/ql/src/jsf/4.28 Portable Code/AV Rule 212.ql
|
||||
ql/cpp/ql/src/jsf/4.28 Portable Code/AV Rule 213.ql
|
||||
ql/cpp/ql/src/jsf/4.28 Portable Code/AV Rule 214.ql
|
||||
ql/cpp/ql/src/jsf/4.28 Portable Code/AV Rule 215.ql
|
||||
ql/cpp/ql/src/utils/modelgenerator/CaptureContentSummaryModels.ql
|
||||
ql/cpp/ql/src/utils/modelgenerator/CaptureNeutralModels.ql
|
||||
ql/cpp/ql/src/utils/modelgenerator/CaptureSinkModels.ql
|
||||
ql/cpp/ql/src/utils/modelgenerator/CaptureSourceModels.ql
|
||||
ql/cpp/ql/src/utils/modelgenerator/CaptureSummaryModels.ql
|
||||
@@ -1,14 +0,0 @@
|
||||
import runs_on
|
||||
import pytest
|
||||
from query_suites import *
|
||||
|
||||
well_known_query_suites = ['cpp-code-quality.qls', 'cpp-security-and-quality.qls', 'cpp-security-extended.qls', 'cpp-code-scanning.qls']
|
||||
|
||||
@runs_on.posix
|
||||
@pytest.mark.parametrize("query_suite", well_known_query_suites)
|
||||
def test(codeql, cpp, check_query_suite, query_suite):
|
||||
check_query_suite(query_suite)
|
||||
|
||||
@runs_on.posix
|
||||
def test_not_included_queries(codeql, cpp, check_queries_not_included):
|
||||
check_queries_not_included('cpp', well_known_query_suites)
|
||||
@@ -1,12 +1,3 @@
|
||||
## 4.3.0
|
||||
|
||||
### New Features
|
||||
|
||||
* New classes `TypeofType`, `TypeofExprType`, and `TypeofTypeType` were introduced, which represent the C23 `typeof` and `typeof_unqual` operators. The `TypeofExprType` class represents the variant taking an expression as its argument. The `TypeofTypeType` class represents the variant taking a type as its argument.
|
||||
* A new class `IntrinsicTransformedType` was introduced, which represents the type transforming intrinsics supported by clang, gcc, and MSVC.
|
||||
* Introduced `hasDesignator()` predicates to distinguish between designated and positional initializations for both struct/union fields and array elements.
|
||||
* Added the `isVla()` predicate to the `ArrayType` class. This allows queries to identify variable-length arrays (VLAs).
|
||||
|
||||
## 4.2.0
|
||||
|
||||
### New Features
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: feature
|
||||
---
|
||||
* Added the `isVla()` predicate to the `ArrayType` class. This allows queries to identify variable-length arrays (VLAs).
|
||||
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: feature
|
||||
---
|
||||
* Introduced `hasDesignator()` predicates to distinguish between designated and positional initializations for both struct/union fields and array elements.
|
||||
@@ -1,8 +0,0 @@
|
||||
## 4.3.0
|
||||
|
||||
### New Features
|
||||
|
||||
* New classes `TypeofType`, `TypeofExprType`, and `TypeofTypeType` were introduced, which represent the C23 `typeof` and `typeof_unqual` operators. The `TypeofExprType` class represents the variant taking an expression as its argument. The `TypeofTypeType` class represents the variant taking a type as its argument.
|
||||
* A new class `IntrinsicTransformedType` was introduced, which represents the type transforming intrinsics supported by clang, gcc, and MSVC.
|
||||
* Introduced `hasDesignator()` predicates to distinguish between designated and positional initializations for both struct/union fields and array elements.
|
||||
* Added the `isVla()` predicate to the `ArrayType` class. This allows queries to identify variable-length arrays (VLAs).
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 4.3.0
|
||||
lastReleaseVersion: 4.2.0
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
extensions:
|
||||
- addsTo:
|
||||
pack: codeql/cpp-all
|
||||
extensible: summaryModel
|
||||
data: []
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/cpp-all
|
||||
version: 4.3.1-dev
|
||||
version: 4.2.1-dev
|
||||
groups: cpp
|
||||
dbscheme: semmlecode.cpp.dbscheme
|
||||
extractor: cpp
|
||||
@@ -16,7 +16,6 @@ dependencies:
|
||||
codeql/xml: ${workspace}
|
||||
dataExtensions:
|
||||
- ext/*.model.yml
|
||||
- ext/generated/*.model.yml
|
||||
- ext/deallocation/*.model.yml
|
||||
- ext/allocation/*.model.yml
|
||||
warnOnImplicitThis: true
|
||||
|
||||
@@ -176,30 +176,6 @@ private class DecltypeDumpType extends DumpType, Decltype {
|
||||
}
|
||||
}
|
||||
|
||||
private class TypeofDumpType extends DumpType, TypeofType {
|
||||
override string getTypeSpecifier() { result = this.getBaseType().(DumpType).getTypeSpecifier() }
|
||||
|
||||
override string getDeclaratorPrefix() {
|
||||
result = this.getBaseType().(DumpType).getDeclaratorPrefix()
|
||||
}
|
||||
|
||||
override string getDeclaratorSuffix() {
|
||||
result = this.getBaseType().(DumpType).getDeclaratorSuffix()
|
||||
}
|
||||
}
|
||||
|
||||
private class IntrinsicTransformedDumpType extends DumpType, IntrinsicTransformedType {
|
||||
override string getTypeSpecifier() { result = this.getBaseType().(DumpType).getTypeSpecifier() }
|
||||
|
||||
override string getDeclaratorPrefix() {
|
||||
result = this.getBaseType().(DumpType).getDeclaratorPrefix()
|
||||
}
|
||||
|
||||
override string getDeclaratorSuffix() {
|
||||
result = this.getBaseType().(DumpType).getDeclaratorSuffix()
|
||||
}
|
||||
}
|
||||
|
||||
private class PointerIshDumpType extends DerivedDumpType {
|
||||
PointerIshDumpType() {
|
||||
this instanceof PointerType or
|
||||
|
||||
@@ -92,9 +92,8 @@ class Type extends Locatable, @type {
|
||||
/**
|
||||
* Gets this type after typedefs have been resolved.
|
||||
*
|
||||
* The result of this predicate will be the type itself, except in the case of a TypedefType, a Decltype,
|
||||
* or a TypeofType, in which case the result will be type which results from (possibly recursively)
|
||||
* resolving typedefs.
|
||||
* The result of this predicate will be the type itself, except in the case of a TypedefType or a Decltype,
|
||||
* in which case the result will be type which results from (possibly recursively) resolving typedefs.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
Type getUnderlyingType() { result = this }
|
||||
@@ -1118,20 +1117,18 @@ class DerivedType extends Type, @derivedtype {
|
||||
* decltype(a) b;
|
||||
* ```
|
||||
*/
|
||||
class Decltype extends Type {
|
||||
Decltype() { decltypes(underlyingElement(this), _, 0, _, _) }
|
||||
|
||||
class Decltype extends Type, @decltype {
|
||||
override string getAPrimaryQlClass() { result = "Decltype" }
|
||||
|
||||
/**
|
||||
* Gets the expression whose type is being obtained by this decltype.
|
||||
* The expression whose type is being obtained by this decltype.
|
||||
*/
|
||||
Expr getExpr() { decltypes(underlyingElement(this), unresolveElement(result), _, _, _) }
|
||||
Expr getExpr() { decltypes(underlyingElement(this), unresolveElement(result), _, _) }
|
||||
|
||||
/**
|
||||
* Gets the type immediately yielded by this decltype.
|
||||
* The type immediately yielded by this decltype.
|
||||
*/
|
||||
Type getBaseType() { decltypes(underlyingElement(this), _, _, unresolveElement(result), _) }
|
||||
Type getBaseType() { decltypes(underlyingElement(this), _, unresolveElement(result), _) }
|
||||
|
||||
/**
|
||||
* Whether an extra pair of parentheses around the expression would change the semantics of this decltype.
|
||||
@@ -1145,7 +1142,7 @@ class Decltype extends Type {
|
||||
* ```
|
||||
* Please consult the C++11 standard for more details.
|
||||
*/
|
||||
predicate parenthesesWouldChangeMeaning() { decltypes(underlyingElement(this), _, _, _, true) }
|
||||
predicate parenthesesWouldChangeMeaning() { decltypes(underlyingElement(this), _, _, true) }
|
||||
|
||||
override Type getUnderlyingType() { result = this.getBaseType().getUnderlyingType() }
|
||||
|
||||
@@ -1186,215 +1183,6 @@ class Decltype extends Type {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An instance of the C23 `typeof` or `typeof_unqual` operator. For example:
|
||||
* ```
|
||||
* int a;
|
||||
* typeof(a) b;
|
||||
* typeof_unqual(const int) b;
|
||||
* ```
|
||||
*/
|
||||
class TypeofType extends Type {
|
||||
TypeofType() {
|
||||
decltypes(underlyingElement(this), _, 1, _, _) or
|
||||
type_operators(underlyingElement(this), _, 0, _)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type immediately yielded by this typeof.
|
||||
*/
|
||||
Type getBaseType() {
|
||||
decltypes(underlyingElement(this), _, _, unresolveElement(result), _)
|
||||
or
|
||||
type_operators(underlyingElement(this), _, _, unresolveElement(result))
|
||||
}
|
||||
|
||||
override Type getUnderlyingType() { result = this.getBaseType().getUnderlyingType() }
|
||||
|
||||
override Type stripTopLevelSpecifiers() { result = this.getBaseType().stripTopLevelSpecifiers() }
|
||||
|
||||
override Type stripType() { result = this.getBaseType().stripType() }
|
||||
|
||||
override Type resolveTypedefs() { result = this.getBaseType().resolveTypedefs() }
|
||||
|
||||
override string toString() { result = "typeof(...)" }
|
||||
|
||||
override string getName() { none() }
|
||||
|
||||
override int getSize() { result = this.getBaseType().getSize() }
|
||||
|
||||
override int getAlignment() { result = this.getBaseType().getAlignment() }
|
||||
|
||||
override int getPointerIndirectionLevel() {
|
||||
result = this.getBaseType().getPointerIndirectionLevel()
|
||||
}
|
||||
|
||||
override string explain() {
|
||||
result = "typeof resulting in {" + this.getBaseType().explain() + "}"
|
||||
}
|
||||
|
||||
override predicate involvesReference() { this.getBaseType().involvesReference() }
|
||||
|
||||
override predicate involvesTemplateParameter() { this.getBaseType().involvesTemplateParameter() }
|
||||
|
||||
override predicate isDeeplyConst() { this.getBaseType().isDeeplyConst() }
|
||||
|
||||
override predicate isDeeplyConstBelow() { this.getBaseType().isDeeplyConstBelow() }
|
||||
|
||||
override Specifier internal_getAnAdditionalSpecifier() {
|
||||
result = this.getBaseType().getASpecifier()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An instance of the C23 `typeof` or `typeof_unqual` operator taking an expression
|
||||
* as its argument. For example:
|
||||
* ```
|
||||
* int a;
|
||||
* typeof(a) b;
|
||||
* ```
|
||||
*/
|
||||
class TypeofExprType extends TypeofType {
|
||||
TypeofExprType() { decltypes(underlyingElement(this), _, 1, _, _) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "TypeofExprType" }
|
||||
|
||||
/**
|
||||
* Gets the expression whose type is being obtained by this typeof.
|
||||
*/
|
||||
Expr getExpr() { decltypes(underlyingElement(this), unresolveElement(result), _, _, _) }
|
||||
|
||||
override Location getLocation() { result = this.getExpr().getLocation() }
|
||||
}
|
||||
|
||||
/**
|
||||
* A type obtained by C23 `typeof` or `typeof_unqual` operator taking a type as its
|
||||
* argument. For example:
|
||||
* ```
|
||||
* typeof_unqual(const int) b;
|
||||
* ```
|
||||
*/
|
||||
class TypeofTypeType extends TypeofType {
|
||||
TypeofTypeType() { type_operators(underlyingElement(this), _, 0, _) }
|
||||
|
||||
/**
|
||||
* Gets the expression whose type is being obtained by this typeof.
|
||||
*/
|
||||
Type getType() { type_operators(underlyingElement(this), unresolveElement(result), _, _) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "TypeofTypeType" }
|
||||
|
||||
override string toString() { result = "typeof(...)" }
|
||||
}
|
||||
|
||||
/**
|
||||
* A type obtained by applying a type transforming intrinsic. For example:
|
||||
* ```
|
||||
* __make_unsigned(int) x;
|
||||
* ```
|
||||
*/
|
||||
class IntrinsicTransformedType extends Type {
|
||||
int intrinsic;
|
||||
|
||||
IntrinsicTransformedType() {
|
||||
type_operators(underlyingElement(this), _, intrinsic, _) and
|
||||
intrinsic in [1 .. 19]
|
||||
}
|
||||
|
||||
override string getAPrimaryQlClass() { result = "IntrinsicTransformedType" }
|
||||
|
||||
override string toString() { result = this.getIntrinsicName() + "(...)" }
|
||||
|
||||
/**
|
||||
* Gets the type immediately yielded by this transformation.
|
||||
*/
|
||||
Type getBaseType() { type_operators(underlyingElement(this), _, _, unresolveElement(result)) }
|
||||
|
||||
/**
|
||||
* Gets the type that is transformed.
|
||||
*/
|
||||
Type getType() { type_operators(underlyingElement(this), unresolveElement(result), _, _) }
|
||||
|
||||
/**
|
||||
* Gets the name of the intrinsic used to transform the type.
|
||||
*/
|
||||
string getIntrinsicName() {
|
||||
intrinsic = 1 and result = "__underlying_type"
|
||||
or
|
||||
intrinsic = 2 and result = "__bases"
|
||||
or
|
||||
intrinsic = 3 and result = "__direct_bases"
|
||||
or
|
||||
intrinsic = 4 and result = "__add_lvalue_reference"
|
||||
or
|
||||
intrinsic = 5 and result = "__add_pointer"
|
||||
or
|
||||
intrinsic = 6 and result = "__add_rvalue_reference"
|
||||
or
|
||||
intrinsic = 7 and result = "__decay"
|
||||
or
|
||||
intrinsic = 8 and result = "__make_signed"
|
||||
or
|
||||
intrinsic = 9 and result = "__make_unsigned"
|
||||
or
|
||||
intrinsic = 10 and result = "__remove_all_extents"
|
||||
or
|
||||
intrinsic = 11 and result = "__remove_const"
|
||||
or
|
||||
intrinsic = 12 and result = "__remove_cv"
|
||||
or
|
||||
intrinsic = 13 and result = "__remove_cvref"
|
||||
or
|
||||
intrinsic = 14 and result = "__remove_extent"
|
||||
or
|
||||
intrinsic = 15 and result = "__remove_pointer"
|
||||
or
|
||||
intrinsic = 16 and result = "__remove_reference_t"
|
||||
or
|
||||
intrinsic = 17 and result = "__remove_restrict"
|
||||
or
|
||||
intrinsic = 18 and result = "__remove_volatile"
|
||||
or
|
||||
intrinsic = 19 and result = "__remove_reference"
|
||||
}
|
||||
|
||||
override Type getUnderlyingType() { result = this.getBaseType().getUnderlyingType() }
|
||||
|
||||
override Type stripTopLevelSpecifiers() { result = this.getBaseType().stripTopLevelSpecifiers() }
|
||||
|
||||
override Type stripType() { result = this.getBaseType().stripType() }
|
||||
|
||||
override Type resolveTypedefs() { result = this.getBaseType().resolveTypedefs() }
|
||||
|
||||
override string getName() { none() }
|
||||
|
||||
override int getSize() { result = this.getBaseType().getSize() }
|
||||
|
||||
override int getAlignment() { result = this.getBaseType().getAlignment() }
|
||||
|
||||
override int getPointerIndirectionLevel() {
|
||||
result = this.getBaseType().getPointerIndirectionLevel()
|
||||
}
|
||||
|
||||
override string explain() {
|
||||
result =
|
||||
"application of " + this.getIntrinsicName() + " resulting in {" + this.getBaseType().explain()
|
||||
+ "}"
|
||||
}
|
||||
|
||||
override predicate involvesReference() { this.getBaseType().involvesReference() }
|
||||
|
||||
override predicate involvesTemplateParameter() { this.getBaseType().involvesTemplateParameter() }
|
||||
|
||||
override predicate isDeeplyConst() { this.getBaseType().isDeeplyConst() }
|
||||
|
||||
override predicate isDeeplyConstBelow() { this.getBaseType().isDeeplyConstBelow() }
|
||||
|
||||
override Specifier internal_getAnAdditionalSpecifier() {
|
||||
result = this.getBaseType().getASpecifier()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A C/C++ pointer type. See 4.9.1.
|
||||
* ```
|
||||
|
||||
@@ -310,8 +310,6 @@ class Expr extends StmtParent, @expr {
|
||||
or
|
||||
exists(Decltype d | d.getExpr() = this.getParentWithConversions*())
|
||||
or
|
||||
exists(TypeofExprType t | t.getExpr() = this.getParentWithConversions*())
|
||||
or
|
||||
exists(ConstexprIfStmt constIf |
|
||||
constIf.getControllingExpr() = this.getParentWithConversions*()
|
||||
)
|
||||
|
||||
@@ -31,6 +31,4 @@ module CppDataFlow implements InputSig<Location> {
|
||||
predicate viableImplInCallContext = Private::viableImplInCallContext/2;
|
||||
|
||||
predicate neverSkipInPathGraph = Private::neverSkipInPathGraph/1;
|
||||
|
||||
int defaultFieldFlowBranchLimit() { result = 3 }
|
||||
}
|
||||
|
||||
@@ -1652,6 +1652,8 @@ predicate validParameterAliasStep(Node node1, Node node2) {
|
||||
)
|
||||
}
|
||||
|
||||
private predicate isTopLevel(Cpp::Stmt s) { any(Function f).getBlock().getAStmt() = s }
|
||||
|
||||
private Cpp::Stmt getAChainedBranch(Cpp::IfStmt s) {
|
||||
result = s.getThen()
|
||||
or
|
||||
@@ -1682,9 +1684,11 @@ private Instruction getAnInstruction(Node n) {
|
||||
}
|
||||
|
||||
private newtype TDataFlowSecondLevelScope =
|
||||
TTopLevelIfBranch(Cpp::Stmt s) { s = getAChainedBranch(_) } or
|
||||
TTopLevelIfBranch(Cpp::Stmt s) {
|
||||
exists(Cpp::IfStmt ifstmt | s = getAChainedBranch(ifstmt) and isTopLevel(ifstmt))
|
||||
} or
|
||||
TTopLevelSwitchCase(Cpp::SwitchCase s) {
|
||||
exists(Cpp::SwitchStmt switchstmt | s = switchstmt.getASwitchCase())
|
||||
exists(Cpp::SwitchStmt switchstmt | s = switchstmt.getASwitchCase() and isTopLevel(switchstmt))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,10 +16,6 @@ private predicate isDeeplyConst(Type t) {
|
||||
or
|
||||
isDeeplyConst(t.(Decltype).getBaseType())
|
||||
or
|
||||
isDeeplyConst(t.(TypeofType).getBaseType())
|
||||
or
|
||||
isDeeplyConst(t.(IntrinsicTransformedType).getBaseType())
|
||||
or
|
||||
isDeeplyConst(t.(ReferenceType).getBaseType())
|
||||
or
|
||||
exists(SpecifiedType specType | specType = t |
|
||||
@@ -40,10 +36,6 @@ private predicate isDeeplyConstBelow(Type t) {
|
||||
or
|
||||
isDeeplyConstBelow(t.(Decltype).getBaseType())
|
||||
or
|
||||
isDeeplyConstBelow(t.(TypeofType).getBaseType())
|
||||
or
|
||||
isDeeplyConstBelow(t.(IntrinsicTransformedType).getBaseType())
|
||||
or
|
||||
isDeeplyConst(t.(PointerType).getBaseType())
|
||||
or
|
||||
isDeeplyConst(t.(ReferenceType).getBaseType())
|
||||
|
||||
@@ -743,17 +743,15 @@ typedefbase(
|
||||
);
|
||||
|
||||
/**
|
||||
* An instance of the C++11 `decltype` operator or C23 `typeof`/`typeof_unqual`
|
||||
* operator taking an expression as its argument. For example:
|
||||
* An instance of the C++11 `decltype` operator. For example:
|
||||
* ```
|
||||
* int a;
|
||||
* decltype(1+a) b;
|
||||
* typeof(1+a) c;
|
||||
* ```
|
||||
* Here `expr` is `1+a`.
|
||||
*
|
||||
* Sometimes an additional pair of parentheses around the expression
|
||||
* changes the semantics of the decltype, e.g.
|
||||
* would change the semantics of this decltype, e.g.
|
||||
* ```
|
||||
* struct A { double x; };
|
||||
* const A* a = new A();
|
||||
@@ -763,55 +761,14 @@ typedefbase(
|
||||
* (Please consult the C++11 standard for more details).
|
||||
* `parentheses_would_change_meaning` is `true` iff that is the case.
|
||||
*/
|
||||
|
||||
/*
|
||||
case @decltype.kind of
|
||||
| 0 = @decltype
|
||||
| 1 = @typeof // The frontend does not differentiate between typeof and typeof_unqual
|
||||
;
|
||||
*/
|
||||
|
||||
#keyset[id, expr]
|
||||
decltypes(
|
||||
int id: @decltype,
|
||||
int expr: @expr ref,
|
||||
int kind: int ref,
|
||||
int base_type: @type ref,
|
||||
boolean parentheses_would_change_meaning: boolean ref
|
||||
);
|
||||
|
||||
/*
|
||||
case @type_operator.kind of
|
||||
| 0 = @typeof // The frontend does not differentiate between typeof and typeof_unqual
|
||||
| 1 = @underlying_type
|
||||
| 2 = @bases
|
||||
| 3 = @direct_bases
|
||||
| 4 = @add_lvalue_reference
|
||||
| 5 = @add_pointer
|
||||
| 6 = @add_rvalue_reference
|
||||
| 7 = @decay
|
||||
| 8 = @make_signed
|
||||
| 9 = @make_unsigned
|
||||
| 10 = @remove_all_extents
|
||||
| 11 = @remove_const
|
||||
| 12 = @remove_cv
|
||||
| 13 = @remove_cvref
|
||||
| 14 = @remove_extent
|
||||
| 15 = @remove_pointer
|
||||
| 16 = @remove_reference_t
|
||||
| 17 = @remove_restrict
|
||||
| 18 = @remove_volatile
|
||||
| 19 = @remove_reference
|
||||
;
|
||||
*/
|
||||
|
||||
type_operators(
|
||||
unique int id: @type_operator,
|
||||
int arg_type: @type ref,
|
||||
int kind: int ref,
|
||||
int base_type: @type ref
|
||||
)
|
||||
|
||||
/*
|
||||
case @usertype.kind of
|
||||
| 0 = @unknown_usertype
|
||||
@@ -1146,10 +1103,10 @@ stmtattributes(
|
||||
@type = @builtintype
|
||||
| @derivedtype
|
||||
| @usertype
|
||||
/* TODO | @fixedpointtype */
|
||||
| @routinetype
|
||||
| @ptrtomember
|
||||
| @decltype
|
||||
| @type_operator;
|
||||
| @decltype;
|
||||
|
||||
unspecifiedtype(
|
||||
unique int type_id: @type ref,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,11 +0,0 @@
|
||||
class Type extends @type {
|
||||
string toString() { none() }
|
||||
}
|
||||
|
||||
class Expr extends @expr {
|
||||
string toString() { none() }
|
||||
}
|
||||
|
||||
from Type decltype, Expr expr, Type basetype, boolean parentheses
|
||||
where decltypes(decltype, expr, basetype, parentheses)
|
||||
select decltype, expr, 0, basetype, parentheses
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
description: Support C23 typeof and typeof_unqual
|
||||
compatibility: partial
|
||||
decltypes.rel: run decltypes.qlo
|
||||
@@ -1,7 +1,3 @@
|
||||
## 1.3.9
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
## 1.3.8
|
||||
|
||||
No user-facing changes.
|
||||
|
||||
@@ -179,7 +179,6 @@ predicate overflows(MulExpr me, Type t) {
|
||||
|
||||
from MulExpr me, Type t1, Type t2
|
||||
where
|
||||
not any(Compilation c).buildModeNone() and
|
||||
t1 = me.getType().getUnderlyingType() and
|
||||
t2 = me.getConversion().getType().getUnderlyingType() and
|
||||
t1.getSize() < t2.getSize() and
|
||||
|
||||
@@ -44,10 +44,6 @@ module CastToPointerArithFlowConfig implements DataFlow::StateConfigSig {
|
||||
) and
|
||||
getFullyConvertedType(node) = state
|
||||
}
|
||||
|
||||
predicate isBarrierIn(DataFlow::Node node) { isSource(node, _) }
|
||||
|
||||
predicate isBarrierOut(DataFlow::Node node) { isSink(node, _) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -154,7 +154,6 @@ int sizeof_IntType() { exists(IntType it | result = it.getSize()) }
|
||||
|
||||
from FormattingFunctionCall ffc, int n, Expr arg, Type expected, Type actual
|
||||
where
|
||||
not any(Compilation c).buildModeNone() and
|
||||
(
|
||||
formattingFunctionCallExpectedType(ffc, n, expected) and
|
||||
formattingFunctionCallActualType(ffc, n, arg, actual) and
|
||||
|
||||
@@ -47,17 +47,11 @@ Type stripType(Type t) {
|
||||
or
|
||||
result = stripType(t.(Decltype).getBaseType())
|
||||
or
|
||||
result = stripType(t.(TypeofType).getBaseType())
|
||||
or
|
||||
result = stripType(t.(IntrinsicTransformedType).getBaseType())
|
||||
or
|
||||
not t instanceof TypedefType and
|
||||
not t instanceof ArrayType and
|
||||
not t instanceof ReferenceType and
|
||||
not t instanceof SpecifiedType and
|
||||
not t instanceof Decltype and
|
||||
not t instanceof TypeofType and
|
||||
not t instanceof IntrinsicTransformedType and
|
||||
result = t
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ predicate isCompiledAsC(File f) {
|
||||
|
||||
from FunctionDeclarationEntry fdeIm, FunctionCall fc
|
||||
where
|
||||
not any(Compilation c).buildModeNone() and
|
||||
isCompiledAsC(fdeIm.getFile()) and
|
||||
not isFromMacroDefinition(fc) and
|
||||
fdeIm.isImplicit() and
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @security-severity 7.8
|
||||
* @precision high
|
||||
* @tags security
|
||||
* external/cwe/cwe-014
|
||||
* external/cwe/cwe-14
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* to it.
|
||||
* @id cpp/count-untrusted-data-external-api
|
||||
* @kind table
|
||||
* @tags security external/cwe/cwe-020
|
||||
* @tags security external/cwe/cwe-20
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* to it.
|
||||
* @id cpp/count-untrusted-data-external-api-ir
|
||||
* @kind table
|
||||
* @tags security external/cwe/cwe-020
|
||||
* @tags security external/cwe/cwe-20
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @precision low
|
||||
* @problem.severity error
|
||||
* @security-severity 7.8
|
||||
* @tags security external/cwe/cwe-020
|
||||
* @tags security external/cwe/cwe-20
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* @precision low
|
||||
* @problem.severity error
|
||||
* @security-severity 7.8
|
||||
* @tags security external/cwe/cwe-020
|
||||
* @tags security external/cwe/cwe-20
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
@@ -51,7 +51,6 @@ int getComparisonSizeAdjustment(Expr e) {
|
||||
|
||||
from Loop l, RelationalOperation rel, VariableAccess small, Expr large
|
||||
where
|
||||
not any(Compilation c).buildModeNone() and
|
||||
small = rel.getLesserOperand() and
|
||||
large = rel.getGreaterOperand() and
|
||||
rel = l.getCondition().getAChild*() and
|
||||
|
||||
@@ -24,12 +24,10 @@ private predicate isCharSzPtrExpr(Expr e) {
|
||||
|
||||
from Expr sizeofExpr, Expr e
|
||||
where
|
||||
not any(Compilation c).buildModeNone() and
|
||||
// If we see an addWithSizeof then we expect the type of
|
||||
// the pointer expression to be `char*` or `void*`. Otherwise it
|
||||
// is probably a mistake.
|
||||
addWithSizeof(e, sizeofExpr, _) and
|
||||
not isCharSzPtrExpr(e)
|
||||
addWithSizeof(e, sizeofExpr, _) and not isCharSzPtrExpr(e)
|
||||
select sizeofExpr,
|
||||
"Suspicious sizeof offset in a pointer arithmetic expression. The type of the pointer is $@.",
|
||||
e.getFullyConverted().getType() as t, t.toString()
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
category: queryMetadata
|
||||
---
|
||||
* The tag `external/cwe/cwe-14` has been removed from `cpp/memset-may-be-deleted` and the tag `external/cwe/cwe-014` has been added.
|
||||
* The tag `external/cwe/cwe-20` has been removed from `cpp/count-untrusted-data-external-api` and the tag `external/cwe/cwe-020` has been added.
|
||||
* The tag `external/cwe/cwe-20` has been removed from `cpp/count-untrusted-data-external-api-ir` and the tag `external/cwe/cwe-020` has been added.
|
||||
* The tag `external/cwe/cwe-20` has been removed from `cpp/untrusted-data-to-external-api-ir` and the tag `external/cwe/cwe-020` has been added.
|
||||
* The tag `external/cwe/cwe-20` has been removed from `cpp/untrusted-data-to-external-api` and the tag `external/cwe/cwe-020` has been added.
|
||||
* The tag `external/cwe/cwe-20` has been removed from `cpp/late-check-of-function-argument` and the tag `external/cwe/cwe-020` has been added.
|
||||
@@ -1,3 +0,0 @@
|
||||
## 1.3.9
|
||||
|
||||
No user-facing changes.
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
lastReleaseVersion: 1.3.9
|
||||
lastReleaseVersion: 1.3.8
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
- queries: .
|
||||
- apply: code-quality-selectors.yml
|
||||
from: codeql/suite-helpers
|
||||
[]
|
||||
@@ -10,7 +10,7 @@
|
||||
* @tags correctness
|
||||
* security
|
||||
* experimental
|
||||
* external/cwe/cwe-020
|
||||
* external/cwe/cwe-20
|
||||
*/
|
||||
|
||||
import cpp
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: codeql/cpp-queries
|
||||
version: 1.3.10-dev
|
||||
version: 1.3.9-dev
|
||||
groups:
|
||||
- cpp
|
||||
- queries
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* @name Capture content based summary models.
|
||||
* @description Finds applicable content based summary models to be used by other queries.
|
||||
* @kind diagnostic
|
||||
* @id cpp/utils/modelgenerator/contentbased-summary-models
|
||||
* @tags modelgenerator
|
||||
*/
|
||||
|
||||
import internal.CaptureModels
|
||||
import SummaryModels
|
||||
|
||||
from DataFlowSummaryTargetApi api, string flow
|
||||
where flow = ContentSensitive::captureFlow(api, _)
|
||||
select flow order by flow
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* @name Capture sink models.
|
||||
* @description Finds public methods that act as sinks as they flow into a known sink.
|
||||
* @kind diagnostic
|
||||
* @id cpp/utils/modelgenerator/sink-models
|
||||
* @tags modelgenerator
|
||||
*/
|
||||
|
||||
import internal.CaptureModels
|
||||
import SinkModels
|
||||
|
||||
from DataFlowSinkTargetApi api, string sink
|
||||
where sink = Heuristic::captureSink(api)
|
||||
select sink order by sink
|
||||
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* @name Capture source models.
|
||||
* @description Finds APIs that act as sources as they expose already known sources.
|
||||
* @kind diagnostic
|
||||
* @id cpp/utils/modelgenerator/source-models
|
||||
* @tags modelgenerator
|
||||
*/
|
||||
|
||||
import internal.CaptureModels
|
||||
import SourceModels
|
||||
|
||||
from DataFlowSourceTargetApi api, string source
|
||||
where source = Heuristic::captureSource(api)
|
||||
select source order by source
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import sys
|
||||
import os.path
|
||||
import subprocess
|
||||
|
||||
# Add Model as Data script directory to sys.path.
|
||||
gitroot = subprocess.check_output(["git", "rev-parse", "--show-toplevel"]).decode("utf-8").strip()
|
||||
madpath = os.path.join(gitroot, "misc/scripts/models-as-data/")
|
||||
sys.path.append(madpath)
|
||||
|
||||
import generate_flow_model as model
|
||||
|
||||
language = "cpp"
|
||||
model.Generator.make(language).run()
|
||||
@@ -1,411 +0,0 @@
|
||||
/**
|
||||
* Provides predicates related to capturing summary models of the Standard or a 3rd party library.
|
||||
*/
|
||||
|
||||
private import cpp as Cpp
|
||||
private import semmle.code.cpp.ir.IR
|
||||
private import semmle.code.cpp.dataflow.ExternalFlow as ExternalFlow
|
||||
private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplCommon as DataFlowImplCommon
|
||||
private import semmle.code.cpp.ir.dataflow.internal.DataFlowImplSpecific
|
||||
private import semmle.code.cpp.ir.dataflow.internal.DataFlowPrivate as DataFlowPrivate
|
||||
private import semmle.code.cpp.dataflow.internal.FlowSummaryImpl as FlowSummaryImpl
|
||||
private import semmle.code.cpp.ir.dataflow.internal.TaintTrackingImplSpecific
|
||||
private import semmle.code.cpp.dataflow.new.TaintTracking as Tt
|
||||
private import semmle.code.cpp.dataflow.new.DataFlow as Df
|
||||
private import codeql.mad.modelgenerator.internal.ModelGeneratorImpl
|
||||
|
||||
/**
|
||||
* Holds if `f` is a "private" function.
|
||||
*
|
||||
* A "private" function does not contribute any models as it is assumed
|
||||
* to be an implementation detail of some other "public" function for which
|
||||
* we will generate a summary.
|
||||
*/
|
||||
private predicate isPrivateOrProtected(Cpp::Function f) {
|
||||
f.getNamespace().getParentNamespace*().isAnonymous()
|
||||
or
|
||||
exists(Cpp::MemberFunction mf | mf = f |
|
||||
mf.isPrivate()
|
||||
or
|
||||
mf.isProtected()
|
||||
)
|
||||
or
|
||||
f.isStatic()
|
||||
}
|
||||
|
||||
private predicate isUninterestingForModels(Callable api) {
|
||||
// Note: This also makes all global/static-local variables
|
||||
// not relevant (which is good!)
|
||||
not api.(Cpp::Function).hasDefinition()
|
||||
or
|
||||
isPrivateOrProtected(api)
|
||||
or
|
||||
api instanceof Cpp::Destructor
|
||||
or
|
||||
api = any(Cpp::LambdaExpression lambda).getLambdaFunction()
|
||||
or
|
||||
api.isFromUninstantiatedTemplate(_)
|
||||
}
|
||||
|
||||
private predicate relevant(Callable api) {
|
||||
api.fromSource() and
|
||||
not isUninterestingForModels(api)
|
||||
}
|
||||
|
||||
module ModelGeneratorCommonInput implements ModelGeneratorCommonInputSig<Cpp::Location, CppDataFlow>
|
||||
{
|
||||
private module DataFlow = Df::DataFlow;
|
||||
|
||||
class Type = DataFlowPrivate::DataFlowType;
|
||||
|
||||
// Note: This also includes `this`
|
||||
class Parameter = DataFlow::ParameterNode;
|
||||
|
||||
class Callable = Cpp::Declaration;
|
||||
|
||||
class NodeExtended extends DataFlow::Node {
|
||||
Callable getAsExprEnclosingCallable() { result = this.asExpr().getEnclosingDeclaration() }
|
||||
}
|
||||
|
||||
Callable getEnclosingCallable(NodeExtended n) {
|
||||
result = n.getEnclosingCallable().asSourceCallable()
|
||||
}
|
||||
|
||||
class InstanceParameterNode extends DataFlow::ParameterNode {
|
||||
InstanceParameterNode() {
|
||||
DataFlowPrivate::nodeHasInstruction(this,
|
||||
any(InitializeParameterInstruction i | i.hasIndex(-1)), 1)
|
||||
}
|
||||
}
|
||||
|
||||
private predicate isFinalMemberFunction(Cpp::MemberFunction mf) {
|
||||
mf.isFinal()
|
||||
or
|
||||
mf.getDeclaringType().isFinal()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the summary generated for `c` should also apply to overrides
|
||||
* of `c`.
|
||||
*/
|
||||
private string isExtensible(Callable c) {
|
||||
if isFinalMemberFunction(c) then result = "false" else result = "true"
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string representing the list of template parameters declared
|
||||
* by `template`.
|
||||
*
|
||||
* `template` must either be:
|
||||
* - An uninstantiated template, or
|
||||
* - A declaration that is not from a template instantiation.
|
||||
*/
|
||||
private string templateParams(Cpp::Declaration template) {
|
||||
exists(string params |
|
||||
params =
|
||||
concat(int i |
|
||||
|
|
||||
template.getTemplateArgument(i).(Cpp::TypeTemplateParameter).getName(), "," order by i
|
||||
)
|
||||
|
|
||||
if params = "" then result = "" else result = "<" + params + ">"
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string representing the list of parameters declared
|
||||
* by `functionTemplate`.
|
||||
*
|
||||
* `functionTemplate` must either be:
|
||||
* - An uninstantiated template, or
|
||||
* - A declaration that is not from a template instantiation.
|
||||
*/
|
||||
private string params(Cpp::Function functionTemplate) {
|
||||
exists(string params |
|
||||
params =
|
||||
concat(int i |
|
||||
|
|
||||
ExternalFlow::getParameterTypeWithoutTemplateArguments(functionTemplate, i, true), ","
|
||||
order by
|
||||
i
|
||||
) and
|
||||
result = "(" + params + ")"
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if the callable `c` is:
|
||||
* - In the namespace represented by `namespace`, and
|
||||
* - Has a declaring type represented by `type`, and
|
||||
* - Has the name `name`, and
|
||||
* - Has a list of parameters represented by `params`
|
||||
*
|
||||
* This is the predicate that computes the columns that it put into the MaD
|
||||
* row for `callable`.
|
||||
*/
|
||||
private predicate qualifiedName(
|
||||
Callable callable, string namespace, string type, string name, string params
|
||||
) {
|
||||
exists(
|
||||
Cpp::Function functionTemplate, string typeWithoutTemplateArgs, string nameWithoutTemplateArgs
|
||||
|
|
||||
functionTemplate = ExternalFlow::getFullyTemplatedFunction(callable) and
|
||||
functionTemplate.hasQualifiedName(namespace, typeWithoutTemplateArgs, nameWithoutTemplateArgs) and
|
||||
nameWithoutTemplateArgs = functionTemplate.getName() and
|
||||
name = nameWithoutTemplateArgs + templateParams(functionTemplate) and
|
||||
params = params(functionTemplate)
|
||||
|
|
||||
exists(Cpp::Class classTemplate |
|
||||
classTemplate = functionTemplate.getDeclaringType() and
|
||||
type = typeWithoutTemplateArgs + templateParams(classTemplate)
|
||||
)
|
||||
or
|
||||
not exists(functionTemplate.getDeclaringType()) and
|
||||
type = ""
|
||||
)
|
||||
}
|
||||
|
||||
predicate isRelevantType(Type t) { any() }
|
||||
|
||||
Type getUnderlyingContentType(DataFlow::ContentSet c) {
|
||||
result = c.(DataFlow::FieldContent).getField().getUnspecifiedType() or
|
||||
result = c.(DataFlow::UnionContent).getUnion().getUnspecifiedType()
|
||||
}
|
||||
|
||||
string qualifierString() { result = "Argument[-1]" }
|
||||
|
||||
private predicate parameterContentAccessImpl(Parameter p, string argument) {
|
||||
exists(int indirectionIndex, int argumentIndex, DataFlowPrivate::Position pos |
|
||||
p.isSourceParameterOf(_, pos) and
|
||||
pos.getArgumentIndex() = argumentIndex and
|
||||
argumentIndex != -1 and // handled elsewhere
|
||||
pos.getIndirectionIndex() = indirectionIndex
|
||||
|
|
||||
indirectionIndex = 0 and
|
||||
argument = "Argument[" + argumentIndex + "]"
|
||||
or
|
||||
indirectionIndex > 0 and
|
||||
argument = "Argument[" + DataFlow::repeatStars(indirectionIndex) + argumentIndex + "]"
|
||||
)
|
||||
}
|
||||
|
||||
string parameterAccess(Parameter p) { parameterContentAccessImpl(p, result) }
|
||||
|
||||
string parameterContentAccess(Parameter p) { parameterContentAccessImpl(p, result) }
|
||||
|
||||
bindingset[c]
|
||||
string paramReturnNodeAsOutput(Callable c, DataFlowPrivate::Position pos) {
|
||||
exists(Parameter p |
|
||||
p.isSourceParameterOf(c, pos) and
|
||||
result = parameterAccess(p)
|
||||
)
|
||||
or
|
||||
pos.getArgumentIndex() = -1 and
|
||||
result = qualifierString() and
|
||||
pos.getIndirectionIndex() = 1
|
||||
}
|
||||
|
||||
bindingset[c]
|
||||
string paramReturnNodeAsContentOutput(Callable c, DataFlowPrivate::ParameterPosition pos) {
|
||||
result = paramReturnNodeAsOutput(c, pos)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
Callable returnNodeEnclosingCallable(DataFlow::Node ret) {
|
||||
result = DataFlowImplCommon::getNodeEnclosingCallable(ret).asSourceCallable()
|
||||
}
|
||||
|
||||
/** Holds if this instance access is to an enclosing instance of type `t`. */
|
||||
pragma[nomagic]
|
||||
private predicate isEnclosingInstanceAccess(DataFlowPrivate::ReturnNode n, Cpp::Class t) {
|
||||
n.getKind().isIndirectReturn(-1) and
|
||||
t = n.getType().stripType() and
|
||||
t != n.getEnclosingCallable().asSourceCallable().(Cpp::Function).getDeclaringType()
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
predicate isOwnInstanceAccessNode(DataFlowPrivate::ReturnNode node) {
|
||||
node.getKind().isIndirectReturn(-1) and
|
||||
not isEnclosingInstanceAccess(node, _)
|
||||
}
|
||||
|
||||
DataFlowPrivate::ParameterPosition getReturnKindParamPosition(DataFlowPrivate::ReturnKind k) {
|
||||
exists(int argumentIndex, int indirectionIndex |
|
||||
k.isIndirectReturn(argumentIndex) and
|
||||
k.getIndirectionIndex() = indirectionIndex and
|
||||
result = DataFlowPrivate::TIndirectionPosition(argumentIndex, indirectionIndex)
|
||||
)
|
||||
}
|
||||
|
||||
string getReturnValueString(DataFlowPrivate::ReturnKind k) {
|
||||
k.isNormalReturn() and
|
||||
exists(int indirectionIndex | indirectionIndex = k.getIndirectionIndex() |
|
||||
indirectionIndex = 0 and
|
||||
result = "ReturnValue"
|
||||
or
|
||||
indirectionIndex > 0 and
|
||||
result = "ReturnValue[" + DataFlow::repeatStars(indirectionIndex) + "]"
|
||||
)
|
||||
}
|
||||
|
||||
predicate containerContent(DataFlow::ContentSet cs) { cs instanceof DataFlow::ElementContent }
|
||||
|
||||
string partialModelRow(Callable api, int i) {
|
||||
i = 0 and qualifiedName(api, result, _, _, _) // namespace
|
||||
or
|
||||
i = 1 and qualifiedName(api, _, result, _, _) // type
|
||||
or
|
||||
i = 2 and result = isExtensible(api) // extensible
|
||||
or
|
||||
i = 3 and qualifiedName(api, _, _, result, _) // name
|
||||
or
|
||||
i = 4 and qualifiedName(api, _, _, _, result) // parameters
|
||||
or
|
||||
i = 5 and result = "" and exists(api) // ext
|
||||
}
|
||||
|
||||
string partialNeutralModelRow(Callable api, int i) {
|
||||
i = 0 and qualifiedName(api, result, _, _, _) // namespace
|
||||
or
|
||||
i = 1 and qualifiedName(api, _, result, _, _) // type
|
||||
or
|
||||
i = 2 and qualifiedName(api, _, _, result, _) // name
|
||||
or
|
||||
i = 3 and qualifiedName(api, _, _, _, result) // parameters
|
||||
}
|
||||
}
|
||||
|
||||
private import ModelGeneratorCommonInput
|
||||
private import MakeModelGeneratorFactory<Cpp::Location, CppDataFlow, CppTaintTracking, ModelGeneratorCommonInput>
|
||||
|
||||
private module SummaryModelGeneratorInput implements SummaryModelGeneratorInputSig {
|
||||
private module DataFlow = Df::DataFlow;
|
||||
|
||||
Parameter asParameter(NodeExtended n) { result = n }
|
||||
|
||||
Callable getAsExprEnclosingCallable(NodeExtended n) {
|
||||
result = n.asExpr().getEnclosingDeclaration()
|
||||
}
|
||||
|
||||
private predicate hasManualSummaryModel(Callable api) {
|
||||
api = any(FlowSummaryImpl::Public::SummarizedCallable sc | sc.applyManualModel()) or
|
||||
api = any(FlowSummaryImpl::Public::NeutralSummaryCallable sc | sc.hasManualModel())
|
||||
}
|
||||
|
||||
/** Gets `api` if it is relevant. */
|
||||
private Callable liftedImpl(Callable api) { result = api and relevant(api) }
|
||||
|
||||
class SummaryTargetApi extends Callable {
|
||||
private Callable lift;
|
||||
|
||||
SummaryTargetApi() {
|
||||
lift = liftedImpl(this) and
|
||||
not hasManualSummaryModel(lift)
|
||||
}
|
||||
|
||||
Callable lift() { result = lift }
|
||||
|
||||
predicate isRelevant() {
|
||||
relevant(this) and
|
||||
not hasManualSummaryModel(this)
|
||||
}
|
||||
}
|
||||
|
||||
predicate isAdditionalContentFlowStep(DataFlow::Node node1, DataFlow::Node node2) {
|
||||
Tt::TaintTracking::defaultAdditionalTaintStep(node1, node2, _) and
|
||||
not exists(DataFlow::Content f |
|
||||
DataFlowPrivate::readStep(node1, f, node2) and containerContent(f)
|
||||
)
|
||||
}
|
||||
|
||||
predicate isField(DataFlow::ContentSet cs) {
|
||||
exists(DataFlow::Content c | cs.isSingleton(c) |
|
||||
c instanceof DataFlow::FieldContent or
|
||||
c instanceof DataFlow::UnionContent
|
||||
)
|
||||
}
|
||||
|
||||
predicate isCallback(DataFlow::ContentSet c) { none() }
|
||||
|
||||
string getSyntheticName(DataFlow::ContentSet c) {
|
||||
exists(Cpp::Field f |
|
||||
not f.isPublic() and
|
||||
f = c.(DataFlow::FieldContent).getField() and
|
||||
result = f.getName()
|
||||
)
|
||||
}
|
||||
|
||||
string printContent(DataFlow::ContentSet c) {
|
||||
exists(int indirectionIndex, string name, string kind |
|
||||
exists(DataFlow::UnionContent uc |
|
||||
c.isSingleton(uc) and
|
||||
name = uc.getUnion().getName() and
|
||||
indirectionIndex = uc.getIndirectionIndex() and
|
||||
// Note: We don't actually support the union string in MaD, but we should do that eventually
|
||||
kind = "Union["
|
||||
)
|
||||
or
|
||||
exists(DataFlow::FieldContent fc |
|
||||
c.isSingleton(fc) and
|
||||
name = fc.getField().getName() and
|
||||
indirectionIndex = fc.getIndirectionIndex() and
|
||||
kind = "Field["
|
||||
)
|
||||
|
|
||||
result = kind + DataFlow::repeatStars(indirectionIndex) + name + "]"
|
||||
)
|
||||
or
|
||||
exists(DataFlow::ElementContent ec |
|
||||
c.isSingleton(ec) and
|
||||
result = "Element[" + ec.getIndirectionIndex() + "]"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private module SourceModelGeneratorInput implements SourceModelGeneratorInputSig {
|
||||
private predicate hasManualSourceModel(Callable api) {
|
||||
api = any(FlowSummaryImpl::Public::NeutralSourceCallable sc | sc.hasManualModel())
|
||||
}
|
||||
|
||||
class SourceTargetApi extends Callable {
|
||||
SourceTargetApi() { relevant(this) and not hasManualSourceModel(this) }
|
||||
}
|
||||
|
||||
predicate sourceNode = ExternalFlow::sourceNode/2;
|
||||
}
|
||||
|
||||
private module SinkModelGeneratorInput implements SinkModelGeneratorInputSig {
|
||||
private module DataFlow = Df::DataFlow;
|
||||
|
||||
private predicate hasManualSinkModel(Callable api) {
|
||||
api = any(FlowSummaryImpl::Public::NeutralSinkCallable sc | sc.hasManualModel())
|
||||
}
|
||||
|
||||
class SinkTargetApi extends Callable {
|
||||
SinkTargetApi() { relevant(this) and not hasManualSinkModel(this) }
|
||||
}
|
||||
|
||||
predicate apiSource(DataFlow::Node source) {
|
||||
DataFlowPrivate::nodeHasOperand(source, any(DataFlow::FieldAddress fa), 1)
|
||||
or
|
||||
source instanceof DataFlow::ParameterNode
|
||||
}
|
||||
|
||||
string getInputArgument(DataFlow::Node source) {
|
||||
exists(DataFlowPrivate::Position pos, int argumentIndex, int indirectionIndex |
|
||||
source.(DataFlow::ParameterNode).isParameterOf(_, pos) and
|
||||
argumentIndex = pos.getArgumentIndex() and
|
||||
indirectionIndex = pos.getIndirectionIndex() and
|
||||
result = "Argument[" + DataFlow::repeatStars(indirectionIndex) + argumentIndex + "]"
|
||||
)
|
||||
or
|
||||
DataFlowPrivate::nodeHasOperand(source, any(DataFlow::FieldAddress fa), 1) and
|
||||
result = qualifierString()
|
||||
}
|
||||
|
||||
predicate sinkNode = ExternalFlow::sinkNode/2;
|
||||
}
|
||||
|
||||
import MakeSummaryModelGenerator<SummaryModelGeneratorInput> as SummaryModels
|
||||
import MakeSourceModelGenerator<SourceModelGeneratorInput> as SourceModels
|
||||
import MakeSinkModelGenerator<SinkModelGeneratorInput> as SinkModels
|
||||
@@ -1,13 +0,0 @@
|
||||
private import cpp as Cpp
|
||||
private import codeql.mad.modelgenerator.internal.ModelPrinting
|
||||
private import CaptureModels::ModelGeneratorCommonInput as ModelGeneratorInput
|
||||
|
||||
private module ModelPrintingLang implements ModelPrintingLangSig {
|
||||
class Callable = Cpp::Declaration;
|
||||
|
||||
predicate partialModelRow = ModelGeneratorInput::partialModelRow/2;
|
||||
|
||||
predicate partialNeutralModelRow = ModelGeneratorInput::partialNeutralModelRow/2;
|
||||
}
|
||||
|
||||
import ModelPrintingImpl<ModelPrintingLang>
|
||||
3
cpp/ql/test/header-variant-tests/clang-pch/_.c
Normal file
3
cpp/ql/test/header-variant-tests/clang-pch/_.c
Normal file
@@ -0,0 +1,3 @@
|
||||
// This file exists to ensure that the output subdirectory exists prior to
|
||||
// a.c being indexed, as said directory needs to exist for the PCH file to
|
||||
// be created, and will be created by running the extractor.
|
||||
3
cpp/ql/test/header-variant-tests/clang-pch/a.c
Normal file
3
cpp/ql/test/header-variant-tests/clang-pch/a.c
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "a.h"
|
||||
#define FOUR 4
|
||||
// semmle-extractor-options: --clang -emit-pch -o ${testdir}/clang-pch.testproj/a.pch
|
||||
4
cpp/ql/test/header-variant-tests/clang-pch/c.c
Normal file
4
cpp/ql/test/header-variant-tests/clang-pch/c.c
Normal file
@@ -0,0 +1,4 @@
|
||||
int main() {
|
||||
return ONE + FOUR;
|
||||
}
|
||||
// semmle-extractor-options: --clang -include ${testdir}/clang-pch.testproj/a -Iextra_dummy_path
|
||||
2
cpp/ql/test/header-variant-tests/clang-pch/d.c
Normal file
2
cpp/ql/test/header-variant-tests/clang-pch/d.c
Normal file
@@ -0,0 +1,2 @@
|
||||
#import "d.h"
|
||||
// semmle-extractor-options: --clang -emit-pch -o ${testdir}/clang-pch.testproj/d.pch
|
||||
4
cpp/ql/test/header-variant-tests/clang-pch/e.c
Normal file
4
cpp/ql/test/header-variant-tests/clang-pch/e.c
Normal file
@@ -0,0 +1,4 @@
|
||||
int main() {
|
||||
return SEVENTEEN;
|
||||
}
|
||||
// semmle-extractor-options: --clang -include-pch ${testdir}/clang-pch.testproj/d.pch
|
||||
6
cpp/ql/test/header-variant-tests/clang-pch/f.c
Normal file
6
cpp/ql/test/header-variant-tests/clang-pch/f.c
Normal file
@@ -0,0 +1,6 @@
|
||||
#if 1
|
||||
#pragma hdrstop
|
||||
extern int x;
|
||||
#define SEEN_F
|
||||
#endif
|
||||
// semmle-extractor-options: --clang -emit-pch -o ${testdir}/clang-pch.testproj/f.pch
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user