Compare commits

..

253 Commits

Author SHA1 Message Date
Michael B. Gale
fb67f93a86 Merge pull request #21330 from github/release-prep/2.24.2
Release preparation for version 2.24.2
2026-02-16 15:00:27 +00:00
github-actions[bot]
ef04f927fb Release preparation for version 2.24.2 2026-02-16 13:29:25 +00:00
Owen Mansel-Chan
7742a5667f Merge pull request #21326 from owen-mc/java/log-injection-regex-match
Java: Recognise `@Pattern` annotation as sanitizer for log injection
2026-02-16 12:14:28 +00:00
Owen Mansel-Chan
cf73d96c9d Update test results (remove SPURIOUS annotations) 2026-02-16 12:03:02 +00:00
Owen Mansel-Chan
597be6a1c0 Add change note 2026-02-16 12:01:15 +00:00
Owen Mansel-Chan
94f1d94a2b Rename MethodCall ma to mc 2026-02-16 12:01:14 +00:00
Owen Mansel-Chan
9fc95f5171 Expand log injection sanitizers to annotation regex matches 2026-02-16 12:01:13 +00:00
Owen Mansel-Chan
924bb92d91 Expand log injection sanitizer guards to non-annotation regex matches 2026-02-16 12:01:11 +00:00
Owen Mansel-Chan
60e58f8219 Refactor logInjectionGuard part 2 2026-02-16 12:01:10 +00:00
Owen Mansel-Chan
6c0c1d558e Refactor logInjectionGuard part 1 2026-02-16 12:01:08 +00:00
Owen Mansel-Chan
146fc7a8c0 Add failing log injection test for @Pattern validation 2026-02-16 12:01:07 +00:00
Jeroen Ketema
7d2b40c657 Merge pull request #21313 from MathiasVP/range-analysis-lower-bound-and-measure-enums
C++: Measure bounds for `Enum` constants and reduce `getBoundsLimit`
2026-02-16 11:50:38 +01:00
Mathias Vorreiter Pedersen
5ccd61ac97 C++: Respond to review comments. 2026-02-16 09:49:31 +00:00
Mathias Vorreiter Pedersen
bfbb2eef6c C++: Add a test showing that we infer a lower and upper bound for parameters of enum types. 2026-02-16 09:38:15 +00:00
Mathias Vorreiter Pedersen
84be8517bb Update cpp/ql/lib/semmle/code/cpp/rangeanalysis/SimpleRangeAnalysis.qll
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-16 09:30:56 +00:00
Tom Hvitved
149f3ed5b6 Merge pull request #21301 from hvitved/rust/type-inference-trait-call-perf
Rust: Speedup type inference for `Trait::function()` calls
2026-02-16 10:20:50 +01:00
Owen Mansel-Chan
47a9f87d9b Merge pull request #21310 from owen-mc/java/regex-execution
Java: Add RegexMatch concept and recognise `@Pattern` annotation as sanitizer
2026-02-16 09:11:47 +00:00
Simon Friis Vindum
6f609a5ed6 Merge pull request #21316 from paldepind/ruby/binary-of-at-start-of-line
Ruby: Add test cases for binary operator at start of line
2026-02-16 09:49:48 +01:00
Owen Mansel-Chan
16ddb5658f Small refactor for stylistic consistency 2026-02-15 14:39:23 +00:00
Owen Mansel-Chan
d6b71a346e Extend RegexMatch framework to allow for MatcherMatchesCall edge case 2026-02-15 14:39:21 +00:00
Owen Mansel-Chan
8f8f4c2d52 Fix Matcher.matches edge case 2026-02-14 00:28:37 +00:00
Owen Mansel-Chan
90befa0c00 Add failing test for Matcher.matches() edge case 2026-02-14 00:28:34 +00:00
Owen Mansel-Chan
ca4c988e97 Remove redundant variable 2026-02-13 22:58:09 +00:00
Owen Mansel-Chan
2e0f244376 Improve QLDoc on RegexMatch.getName() 2026-02-13 22:55:01 +00:00
Owen Mansel-Chan
c7099584b4 Put imports implementing abstract classes in private module 2026-02-13 22:51:53 +00:00
Owen Mansel-Chan
3c161f9c93 Make contract of RegexMatch clear 2026-02-13 22:47:44 +00:00
Owen Mansel-Chan
1fefa989d7 Rename RegexMatch and only include expressions 2026-02-13 22:45:48 +00:00
Owen Mansel-Chan
953ff9f0d0 PatternAnnotation.getString() should only be field reads 2026-02-13 22:41:20 +00:00
Owen Mansel-Chan
106254b220 Improve QLDocs 2026-02-13 22:40:36 +00:00
Owen Mansel-Chan
5bdf550317 Fix QLDocs 2026-02-12 16:57:14 +00:00
Owen Mansel-Chan
c539c2f4fd Add change note 2026-02-12 16:57:12 +00:00
Owen Mansel-Chan
bfe26c1989 Add @Pattern as RegexExecution => SSRF sanitizer 2026-02-12 16:57:11 +00:00
Owen Mansel-Chan
d0999e3abd Add failing test for @Pattern validation 2026-02-12 16:57:04 +00:00
Simon Friis Vindum
bf02e478fd Rust: Comment out tests with parse errors 2026-02-12 14:49:09 +01:00
Taus
7d17454a3b Merge pull request #21138 from github/tausbn/python-prepare-for-overlay-annotations
Prepare dataflow for local annotations
2026-02-12 14:23:45 +01:00
Taus
3e5c2ddeaf Merge pull request #21308 from github/smowton/admin/path-injection-use-autofix-qhelp
Python: use path-injection qhelp variant employed by autofix
2026-02-12 13:17:08 +01:00
Chris Smowton
5f970d9f2f Rewordings per copilot 2026-02-12 12:01:33 +00:00
Simon Friis Vindum
218585b52a Ruby: Add additonal tests with operators at the start of lines 2026-02-12 12:30:43 +01:00
Anders Schack-Mulligen
a945f15987 Merge pull request #21317 from aschackmull/java/deprecate-unreachableblocks
Java: Deprecate UnreachableBlocks.
2026-02-12 11:43:37 +01:00
Anders Schack-Mulligen
5c53677051 Java: Deprecate UnreachableBlocks. 2026-02-12 11:06:34 +01:00
Mathias Vorreiter Pedersen
2dc91a56eb C++: Lower the treshold for max number of bounds to 2^29. 2026-02-12 09:44:20 +00:00
Mathias Vorreiter Pedersen
6dd6bddff3 C++: Add more terms to make range analysis test timeout. 2026-02-12 09:44:17 +00:00
Mathias Vorreiter Pedersen
a4dd4f91d4 C++: Also compute type bounds for accesses of an enum type. 2026-02-12 09:44:14 +00:00
Mathias Vorreiter Pedersen
90a16cfaee Merge pull request #21314 from MathiasVP/remove-tc
C++: Remove redundant transitive closure
2026-02-12 09:21:56 +00:00
Simon Friis Vindum
a27d20dbcd Rust: Add test cases for binary operator at start of line 2026-02-12 09:31:59 +01:00
Michael Nebel
76ed386246 Merge pull request #21315 from github/workflow/coverage/update
Update CSV framework coverage reports
2026-02-12 08:29:25 +01:00
github-actions[bot]
fea07ebfcb Add changed framework coverage reports 2026-02-12 00:32:08 +00:00
Mathias Vorreiter Pedersen
9596b7b921 C++: No need to compute this TC. 2026-02-11 20:18:03 +00:00
Mathias Vorreiter Pedersen
b14ece72be C++: Add range analysis test demonstrating missing measuring bounds. 2026-02-11 16:58:18 +00:00
Owen Mansel-Chan
6a8204d28c "dataflow" -> "data flow" in QLDoc 2026-02-11 13:41:14 +00:00
Owen Mansel-Chan
1ee5728311 Add missing QLDoc 2026-02-11 13:40:20 +00:00
Owen Mansel-Chan
a22fd39230 Use RegexExecution in sanitizer definitions (expands scope) 2026-02-11 13:09:48 +00:00
Owen Mansel-Chan
fa3fba4a00 Use new regex-related classes (no functional change) 2026-02-11 13:09:46 +00:00
Owen Mansel-Chan
44eeee5757 Add and improve classes for regex-related methods 2026-02-11 13:09:45 +00:00
Owen Mansel-Chan
e6dbd525c3 Add RegexExecution in Concepts.qll 2026-02-11 13:09:42 +00:00
Simon Friis Vindum
522e4d64de Merge pull request #21273 from paldepind/rust/tp-assoc
Rust: Implement support for associated types accessed on type parameters
2026-02-11 13:39:55 +01:00
Chris Smowton
bed1ec8981 Enhance path validation recommendations
Expanded recommendations for validating user input when constructing file paths, including normalization and using allowlists.
2026-02-11 12:10:08 +00:00
Simon Friis Vindum
6c67475352 Rust: Minor tweaks in type inference 2026-02-11 12:32:54 +01:00
Simon Friis Vindum
287a8717a8 Rust: Apply suggestions from code review
Co-authored-by: Tom Hvitved <hvitved@github.com>
2026-02-11 12:19:22 +01:00
Philip Ginsbach-Chen
9ed22610a3 Merge pull request #21306 from github/ginsbach/avoid-nontrivially-shadowing-toString
Avoid non-trivially shadowing `string.toString()`
2026-02-11 11:03:07 +00:00
Tom Hvitved
36c3084435 Merge pull request #21305 from hvitved/rust/type-inference-speedup
Rust: Speedup `inferMethodCallTypeSelf`
2026-02-11 11:03:06 +01:00
Tom Hvitved
37af38eed5 Merge pull request #21282 from hvitved/rust/path-resolution/type-inference-expectations
Rust: Distinguish path resolution expectations from type inference expectations
2026-02-11 11:00:28 +01:00
Tom Hvitved
89e9a253eb Rust: Distinguish path resolution expectations from type inference expectations 2026-02-11 10:33:41 +01:00
Simon Friis Vindum
2fa71f0c17 Rust: Add examples with associated type accessed on associated type 2026-02-11 09:10:21 +01:00
Simon Friis Vindum
2b10c8aef3 Rust: Fix gramar in qldoc 2026-02-11 09:09:34 +01:00
Michael Nebel
0ac1bc4c57 Merge pull request #21299 from microsoft/lwsimpkins/csharp-mad-httputility-upstream
Update MaD for System.Web.HttpUtility
2026-02-11 08:47:29 +01:00
Anders Schack-Mulligen
cfa62ae434 Merge pull request #21304 from aschackmull/java/deprecation-followup
Java: Add delayed deprecation annotation.
2026-02-11 08:40:01 +01:00
Owen Mansel-Chan
766dc94444 Merge pull request #21150 from github/jketema/go-1.26
Go: Update to 1.26
2026-02-11 04:37:31 +00:00
Owen Mansel-Chan
542d4631d7 restore ~ in action.yml version 2026-02-10 22:32:36 +00:00
Owen Mansel-Chan
f01d5840b0 Update to 1.26.0 2026-02-10 22:32:33 +00:00
Owen Mansel-Chan
936c4cc79f Fix edge case in MaD validation
If the db contains no pointer types then we were getting spurious model
validation errors.
2026-02-10 22:32:31 +00:00
Owen Mansel-Chan
e1bddd9365 Model newly added functions 2026-02-10 22:32:30 +00:00
Owen Mansel-Chan
22e9c212d6 Add failing tests for newly added functions 2026-02-10 22:32:28 +00:00
Owen Mansel-Chan
26ef33212d Test builtins like standard library 2026-02-10 22:32:27 +00:00
Jeroen Ketema
700543b30b Go: Update supported versions to include 1.26 2026-02-10 22:31:11 +00:00
Jeroen Ketema
22e9b42808 Go: Add change note 2026-02-10 22:31:10 +00:00
Jeroen Ketema
50ed0af9da Go: Bump maxGoVersion to 1.26 2026-02-10 22:31:08 +00:00
Jeroen Ketema
e00e3a87ff Update Go version in tests to 1.26.0 2026-02-10 22:31:00 +00:00
Tom Hvitved
8955fd0bf4 Merge pull request #21303 from hvitved/rust/add-telemetry-tags
Rust: Add `telemtry` tags to queries
2026-02-10 20:13:40 +01:00
Philip Ginsbach
f60d759a65 Avoid non-trivially shadowing string.toString()
Prepare libraries for a possible deprecation warning on shadowing
string.toString().

These instanceof classes were using this.(Type).method() to call
supertype methods, but super.method() is clearer and equivalent
for instanceof supertypes.
2026-02-10 15:46:10 +00:00
Ian Lynagh
00acff293a Merge pull request #21281 from igfoo/igfoo/discarding
C++ overlay: Discarding elements
2026-02-10 15:14:58 +00:00
Tom Hvitved
49f24ca8ec Rust: Avoid using regexpCapture with multiple capture groups 2026-02-10 16:11:49 +01:00
Tom Hvitved
564a3bd444 Rust: Simplify inferMethodCallTypeSelf 2026-02-10 15:30:56 +01:00
Michael Nebel
ece85854cd Merge pull request #21285 from michaelnebel/csharp14/implicittypedlambdaparametermodifiers
C# 14: [TEST ONLY] Simple lambda parameters with modifiers.
2026-02-10 14:16:19 +01:00
Michael Nebel
c15ad31b07 Merge pull request #21220 from michaelnebel/csharp14/extension
C# 14: Support `extension` types.
2026-02-10 14:15:57 +01:00
Anders Schack-Mulligen
5116b0c1e5 Java: Add delayed deprecation annotation. 2026-02-10 14:02:48 +01:00
Michael Nebel
25b836b1b5 C#: Apply suggestions from code review
Co-authored-by: Tom Hvitved <hvitved@github.com>
2026-02-10 13:12:53 +01:00
Owen Mansel-Chan
f2d3bc03aa Merge pull request #21302 from github/mbg/go/bump-to-1.25.7
Go: Bump toolchain to `1.25.7`
2026-02-10 10:33:50 +00:00
Tom Hvitved
55e5bc4970 Rust: Add telemtry tags to queries 2026-02-10 11:25:42 +01:00
Michael B. Gale
518fb44a92 Go: Bump toolchain to 1.25.7 2026-02-10 10:01:38 +00:00
Tom Hvitved
5634395a32 Rust: Speedup type inference for Trait::function() calls 2026-02-10 10:50:59 +01:00
Michael B. Gale
eee4014e94 Merge pull request #21300 from github/dependabot/go_modules/go/extractor/extractor-dependencies-393b62c927
Bump the extractor-dependencies group in /go/extractor with 2 updates
2026-02-10 09:46:56 +00:00
Simon Friis Vindum
a033057d90 Rust: Fix a bad join 2026-02-10 09:54:01 +01:00
Simon Friis Vindum
624ee1898a Rust: Implement support for associated types accessed on type parameters 2026-02-10 09:53:56 +01:00
Simon Friis Vindum
0cd5366034 Rust: Add type inference test for associated type acces on a type parameter of an impl block 2026-02-10 09:51:56 +01:00
Simon Friis Vindum
78c262ca63 Merge pull request #21297 from hvitved/rust/type-inference-fix-bug
Rust: Fix bug in `inferMethodCallTypeSelf`
2026-02-10 09:51:12 +01:00
Tom Hvitved
c3ac20267a Merge pull request #21217 from hvitved/rust/type-inference-perf
Rust: Rework call disambiguation logic
2026-02-10 08:52:01 +01:00
dependabot[bot]
e172cb3f7a Bump the extractor-dependencies group in /go/extractor with 2 updates
Bumps the extractor-dependencies group in /go/extractor with 2 updates: [golang.org/x/mod](https://github.com/golang/mod) and [golang.org/x/tools](https://github.com/golang/tools).


Updates `golang.org/x/mod` from 0.32.0 to 0.33.0
- [Commits](https://github.com/golang/mod/compare/v0.32.0...v0.33.0)

Updates `golang.org/x/tools` from 0.41.0 to 0.42.0
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.41.0...v0.42.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-version: 0.33.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: extractor-dependencies
- dependency-name: golang.org/x/tools
  dependency-version: 0.42.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: extractor-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-10 03:15:54 +00:00
Lindsay Simpkins
677949e409 Fix typo in change note
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-09 17:16:10 -05:00
Lindsay Simpkins
fe10fb37e9 add changenote 2026-02-09 16:48:08 -05:00
Lindsay Simpkins
ba3fc0a769 update csharp MaD for System.Web.HttpUtility for tainted URIs 2026-02-09 16:48:05 -05:00
Tom Hvitved
6611978368 Update rust/ql/lib/codeql/rust/internal/typeinference/DerefChain.qll
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-09 19:38:49 +01:00
Tom Hvitved
16539b4667 Address review comments 2026-02-09 19:30:58 +01:00
Ian Lynagh
6235edaa21 C++: Update stats 2026-02-09 18:01:02 +00:00
Ian Lynagh
9a5128f915 C++: Add up/downgrade scripts 2026-02-09 18:01:01 +00:00
Ian Lynagh
c5f6820b5d C++ overlay: Add trap_filename, source_file_uses_trap, in_trap 2026-02-09 18:01:01 +00:00
yoff
5ad42f8bcc Merge pull request #20563 from microsoft/azure_python_sdk_url_summary_upstream
Azure python sdk url summary upstream
2026-02-09 18:34:36 +01:00
Michael Nebel
bee1718469 QL4QL: Allow Impl classes to implement getAPrimaryQLClass with non Impl suffix. 2026-02-09 16:53:43 +01:00
Michael Nebel
3e914f7ff1 C#: Add DB downgrade script. 2026-02-09 16:24:19 +01:00
Michael Nebel
42d2de848d C#: Add DB upgrade script. 2026-02-09 16:24:00 +01:00
Ian Lynagh
b5e3168032 Merge pull request #21286 from github/andersfugmann/kotlin_2.3.10-no-artifacts
Kotlin: Support Kotlin 2.3.10
2026-02-09 13:26:40 +00:00
Tom Hvitved
109d802607 Rust: Fix bug in inferMethodCallTypeSelf 2026-02-09 14:15:05 +01:00
Michael B. Gale
71e8730c63 Merge pull request #21263 from github/mbg/csharp/registry-diagnostic
C#: Add diagnostic for private registry usage
2026-02-09 12:58:43 +00:00
Michael Nebel
eff9f99f44 C#: Update test expected output. 2026-02-09 13:30:14 +01:00
Michael Nebel
d9fea156f6 C#: Update MaD models for extension members. 2026-02-09 13:28:11 +01:00
Michael Nebel
bcdbd6e283 C#: Use the fully qualified name for the extension type when printing extension types. 2026-02-09 13:27:32 +01:00
Michael Nebel
fe94b3b68b C#: Address review comments. 2026-02-09 11:46:53 +01:00
Owen Mansel-Chan
90401b3ad3 Merge pull request #21254 from owen-mc/go/astnode-get-enclosing-block
Go: Add `AstNode.getEnclosingBlock()`
2026-02-06 22:23:15 +00:00
Jon Janego
d0bd8459a1 Merge pull request #21291 from github/codeql-spark-run-21760759512
Update changelog documentation site
2026-02-06 12:28:56 -06:00
Jon Janego
1c43ceae95 Merge branch 'main' into codeql-spark-run-21760759512 2026-02-06 12:16:31 -06:00
Jon Janego
5bf2d9442e Fix formatting in changelog for Go path injection query 2026-02-06 12:14:03 -06:00
Jon Janego
c40d784a4d Update codeql-cli-2.23.1.rst 2026-02-06 12:13:34 -06:00
Jon Janego
bf6568b928 Fix formatting for Kotlin version support note 2026-02-06 12:12:55 -06:00
Jon Janego
79ad064a93 Fix formatting in Kotlin version support note 2026-02-06 12:12:16 -06:00
Jon Janego
552976d057 Update codeql-cli-2.19.1.rst 2026-02-06 12:11:49 -06:00
github-actions[bot]
353cd31ce6 update codeql documentation 2026-02-06 18:09:49 +00:00
Paolo Tranquilli
48db24d184 Merge pull request #21287 from github/redsun82/fix-rust-deps-patching
Bazel: fix Rust deps patching for semver build metadata
2026-02-06 17:17:24 +01:00
REDMOND\brodes
8459eec239 Moving the SsrfSink concept into Concepts.qll, and renaming to HttpClientRequestFromModel as suggested in PR review. 2026-02-06 09:26:49 -05:00
Anders Fugmann
c5179e40c6 Kotlin: Add change note for supporting 2.3.10 2026-02-06 14:59:34 +01:00
github-actions[bot]
38830ddc5c Bazel: fix Rust deps patching for semver build metadata
Handle crate versions containing `+` build metadata (e.g., `0.9.11+spec-1.1.0`).
Bazel repo names use `-` instead of `+`, so the generated labels need patching
to reference the correct repo name.

Also adds documentation for both patching issues handled by patch_defs.py.
2026-02-06 14:58:34 +01:00
Anders Fugmann
d5827b5cca Kotlin: Support Kotlin 2.3.10 2026-02-06 14:54:08 +01:00
Michael Nebel
6c355a1bf8 C#: Update test expected output. 2026-02-06 14:38:27 +01:00
Michael Nebel
e550d4937c C#: Update parameter modifiers test to include lambda expression from the new test file. 2026-02-06 14:37:50 +01:00
Michael Nebel
62a6b5985d C#: Add test cases for lambda parameter modifiers. 2026-02-06 14:37:11 +01:00
Mathias Vorreiter Pedersen
2c05624088 Merge pull request #21280 from MathiasVP/make-getChildCount-more-robust
C++: Make 'getChildCount' more robust by counting indices instead of elements
2026-02-06 12:19:20 +00:00
Ben Rodes
ac1987f264 Update python/ql/lib/change-notes/2025-09-30-azure_ssrf_models.md
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2026-02-05 15:44:44 -05:00
Mathias Vorreiter Pedersen
d57a42a7f7 C++: Make 'getChildCount' more robust by counting indexes instead of 'TranslatedDeclarationEntry's. 2026-02-05 20:23:45 +00:00
Tom Hvitved
32aaac27ec Rust: Add type inference regression test 2026-02-05 17:29:42 +01:00
Tom Hvitved
2dc7576232 Rust: Rework call disambiguation logic 2026-02-05 17:29:40 +01:00
Taus
5adc9f8ff0 Merge pull request #21274 from github/tausbn/python-fix-parsing-of-format-specifiers
Python: Fix syntax error when `=` is used as a format fill character
2026-02-05 16:37:42 +01:00
Michael Nebel
02e4a8b6f7 C#: Add change-note. 2026-02-05 15:52:43 +01:00
Michael Nebel
bd3e4d3d7e C#: Add MaD tests for extensions. 2026-02-05 15:38:29 +01:00
Michael Nebel
4b6a53b577 C#: Add extension data flow test. 2026-02-05 15:38:27 +01:00
Michael Nebel
6cbe000d51 C#: Add PrintAst test for extensions. 2026-02-05 15:38:25 +01:00
Michael Nebel
c040daab9c C#: Add extensions test. 2026-02-05 15:38:20 +01:00
Michael Nebel
849823eff6 C#: Add dispatch logic for calling extensions accessors as methods. 2026-02-05 15:38:16 +01:00
Michael Nebel
e831c80a23 C#: Replace extension parameter access with the corresponding synthetic parameter. 2026-02-05 15:38:14 +01:00
Michael Nebel
5e02a86542 C#: Add extension call classes. 2026-02-05 15:38:12 +01:00
Michael Nebel
b9f36f37b6 C#: Add extension callable and accessor classes. 2026-02-05 15:38:09 +01:00
Michael Nebel
9a4a6cfcb8 C#: Add ExtensionType to the QL library. 2026-02-05 15:38:07 +01:00
Michael Nebel
edfdc9812f C#: Extract extension types and members. Replacing invocations to static generated methods with invocation of extension type member. 2026-02-05 15:38:05 +01:00
Michael Nebel
ab505e3281 C#: Add class for making synthetic parameter entities. 2026-02-05 15:38:02 +01:00
Taus
8c27437628 Python: Bump extractor version and add change note 2026-02-05 13:50:54 +00:00
Taus
12ee93042b Python: Add tests 2026-02-05 13:47:24 +00:00
Taus
bac356c9a1 Python: Regenerate parser files 2026-02-05 13:46:59 +00:00
Taus
68c1a3d389 Python: Fix syntax error when = is used as a format fill character
An example (provided by @redsun82) is the string `f"{x:=^20}"`. Parsing
this (with unnamed nodes shown) illustrates the problem:

```
module [0, 0] - [2, 0]
  expression_statement [0, 0] - [0, 11]
    string [0, 0] - [0, 11]
      string_start [0, 0] - [0, 2]
      interpolation [0, 2] - [0, 10]
        "{" [0, 2] - [0, 3]
        expression: named_expression [0, 3] - [0, 9]
          name: identifier [0, 3] - [0, 4]
          ":=" [0, 4] - [0, 6]
          ERROR [0, 6] - [0, 7]
            "^" [0, 6] - [0, 7]
          value: integer [0, 7] - [0, 9]
        "}" [0, 9] - [0, 10]
      string_end [0, 10] - [0, 11]
```
Observe that we've managed to combine the format specifier token `:` and
the fill character `=` in a single token (which doesn't match the `:` we
expect in the grammar rule), and hence we get a syntax error.

If we change the `=` to some other character (e.g. a `-`), we instead
get

```
module [0, 0] - [2, 0]
  expression_statement [0, 0] - [0, 11]
    string [0, 0] - [0, 11]
      string_start [0, 0] - [0, 2]
      interpolation [0, 2] - [0, 10]
        "{" [0, 2] - [0, 3]
        expression: identifier [0, 3] - [0, 4]
        format_specifier: format_specifier [0, 4] - [0, 9]
          ":" [0, 4] - [0, 5]
        "}" [0, 9] - [0, 10]
      string_end [0, 10] - [0, 11]
```
and in particular no syntax error.

To fix this, we want to ensure that the `:` is lexed on its own, and the
`token(prec(1, ...))` construction can be used to do exactly this.

Finally, you may wonder why `=` is special here. I think what's going on
is that the lexer knows that `:=` is a token on its own (because it's
used in the walrus operator), and so it greedily consumes the following
`=` with this in mind.
2026-02-05 13:45:54 +00:00
Tom Hvitved
2764d697d2 Rust: Merge Input1 and Input2 modules 2026-02-05 14:29:46 +01:00
Tom Hvitved
c62d95ac9d Rust: More type inference tests 2026-02-05 14:29:41 +01:00
Paolo Tranquilli
05bef12ddd Merge pull request #21265 from github/redsun82/csharp-csrf-inheritance
C#: Fix CSRF query to check antiforgery attributes on base classes
2026-02-05 14:20:30 +01:00
Idriss Riouak
1df3adf021 Merge pull request #21244 from github/idrissrio/cpp/overlay/changes-json
C/C++ overlay: use files table instead of `overlayChangedFiles` for overlay discard
2026-02-05 13:15:07 +01:00
Tom Hvitved
025f73301b Rust: Move some overloading tests into a separate file 2026-02-05 12:49:53 +01:00
idrissrio
e26c199426 C/C++ overlay: use files table instead of overlayChangedFiles for overlay discard 2026-02-05 12:43:01 +01:00
Tom Hvitved
1203da1b66 Merge pull request #21253 from paldepind/rust/as-path-trait
Rust: Resolve `as` paths to trait
2026-02-05 12:38:16 +01:00
Paolo Tranquilli
f79bd3f4cf C#: accept location changes in test 2026-02-05 12:14:59 +01:00
Mathias Vorreiter Pedersen
476df7de73 Merge pull request #21260 from MathiasVP/add-windows-remote-flow-sources
C++: Add more Win32 and Azure SDK remote flow sources
2026-02-05 10:47:03 +00:00
Anders Schack-Mulligen
29e01748b7 Merge pull request #21267 from aschackmull/java/rename-misc
Java: Rename several AST predicates.
2026-02-05 11:15:29 +01:00
Anders Schack-Mulligen
11003e685d Java: Fix qldoc 2026-02-05 10:37:19 +01:00
Anders Schack-Mulligen
e4daeec2ca Merge pull request #21268 from aschackmull/java/view-cfg
Java: Add support for "View CFG" in VSCode.
2026-02-05 09:48:14 +01:00
Anders Schack-Mulligen
81977f11a1 Cfg: qldoc + overlay fixups. 2026-02-05 08:59:28 +01:00
Anders Schack-Mulligen
32fe12a6dd Java: Delay deprecation a bit. 2026-02-05 08:51:27 +01:00
Anders Schack-Mulligen
83adf793e4 Cfg: Fix compilation. 2026-02-04 15:28:37 +01:00
REDMOND\brodes
0a88425170 Python: Altering SSRF MaD to use 'request-forgery' tag. Update to test cases expected results, off by one line. Changed to using ModelOutput::sinkNode. 2026-02-04 09:04:22 -05:00
Ben Rodes
cd73dcfb04 Merge branch 'main' into azure_python_sdk_url_summary_upstream 2026-02-04 08:55:38 -05:00
Simon Friis Vindum
52dc58172d Merge branch 'main' into rust/as-path-trait 2026-02-04 14:47:57 +01:00
Owen Mansel-Chan
544931f73f Merge pull request #21266 from owen-mc/python/pretty-print-models-in-test
Python: Pretty print models in test
2026-02-04 13:46:51 +00:00
Anders Schack-Mulligen
2d02908e7f Java: Add change note. 2026-02-04 14:43:32 +01:00
Anders Schack-Mulligen
4fcf3fbff8 Java: Make loop classes extend LoopStmt and use getBody instead of getStmt. 2026-02-04 14:43:31 +01:00
Anders Schack-Mulligen
6f40ac15b4 Java: Rename ReturnStmt.getResult to getExpr. 2026-02-04 14:43:31 +01:00
Simon Friis Vindum
55ea55a44f Merge pull request #21247 from paldepind/rust/self-types
Rust: Resolve `Self` paths in type definitions
2026-02-04 13:41:53 +01:00
Anders Schack-Mulligen
36fa0a22f9 Java: Rename getTrueExpr/getFalseExpr on ConditionalExpr to getThen/getElse. 2026-02-04 13:38:11 +01:00
Michael Nebel
60bb9a9b06 C#: Move some populate methods and location writing methods. 2026-02-04 13:24:21 +01:00
Michael Nebel
c68cd58f70 C#: Add parameter marker interface, allow a type to a parent for parameter and make it possible to specify a parameter position offset. 2026-02-04 13:19:29 +01:00
Michael Nebel
dca10f8740 C#: Add extended_type to the DB scheme. 2026-02-04 12:51:30 +01:00
Owen Mansel-Chan
3f08ff88a4 Pretty print models in test
Otherwise the tests breaks when unrelated changes are made because the
model numbers change
2026-02-04 10:52:44 +00:00
Anders Schack-Mulligen
5e6e64b2b7 Java: Rename UnaryExpr.getExpr to getOperand. 2026-02-04 10:50:49 +01:00
Paolo Tranquilli
4973523404 C#: Fix CSRF query to check antiforgery attributes on base classes
Fixes https://github.com/github/codeql/discussions/21255
2026-02-04 09:42:20 +01:00
Taus
62fb38d834 Python: Rename otherArgs to implicitArgumentNode
Co-authored-by: yoff <yoff@github.com>
2026-02-03 15:32:46 +00:00
Michael B. Gale
571f21ba49 C#: Emit diagnostic if private registries are configured 2026-02-03 15:28:47 +00:00
Anders Schack-Mulligen
2d61fc5309 Java: Add support for "View CFG". 2026-02-03 15:49:27 +01:00
Michael B. Gale
8e39ed079e Merge pull request #21252 from github/mbg/go/private-registry-diagnostic
Go: Add diagnostic for private registry usage
2026-02-03 14:36:19 +00:00
Anders Schack-Mulligen
389cd5d648 Cfg: Extract CFG pretty-printing code. 2026-02-03 15:33:55 +01:00
Mathias Vorreiter Pedersen
092d25451f C++: Fix Copilot comments. 2026-02-03 11:45:30 +00:00
Mathias Vorreiter Pedersen
32b86eca50 C++: Add change note. 2026-02-03 11:40:31 +00:00
Mathias Vorreiter Pedersen
40a58135c2 C++: Accept test changes. 2026-02-03 11:30:55 +00:00
Mathias Vorreiter Pedersen
7ef96e3f3c C++: Add taint-inheriting reads from the Winhttp structs. 2026-02-03 11:30:31 +00:00
Mathias Vorreiter Pedersen
5531ef9bc1 C++: Accept test changes. 2026-02-03 11:17:23 +00:00
Mathias Vorreiter Pedersen
cbc2dbc14d C++: Add flow sources and summary models. 2026-02-03 11:14:16 +00:00
Mathias Vorreiter Pedersen
208cf716dc C++: Add tests with tests for remote flow sources from the Win32 API and from the Azure SDK. 2026-02-03 11:13:45 +00:00
Simon Friis Vindum
d72d8b63ed Rust: Fix inconsistency by skipping Self in use globs 2026-02-03 11:54:28 +01:00
Simon Friis Vindum
1791c1f1f9 Rust: Add test with path resolution inconsistency 2026-02-03 11:51:55 +01:00
Michael B. Gale
d5c4a19efa Apply suggestions from code review
Co-authored-by: Owen Mansel-Chan <62447351+owen-mc@users.noreply.github.com>
2026-02-03 10:34:14 +00:00
Tom Hvitved
6fbf727309 Merge pull request #21251 from hvitved/rust/fix-bad-join
Rust: Fix bad join
2026-02-02 19:12:30 +01:00
Owen Mansel-Chan
e00390d23a Merge pull request #21224 from owen-mc/go/use-shared-basic-block-lib
Go: Use shared basic block lib
2026-02-02 16:31:06 +00:00
Michael B. Gale
d079671ec8 Align testItems with what getEnvVars does 2026-02-02 16:17:22 +00:00
Michael B. Gale
cbbc057dd3 Fix singular/plural wording and add test 2026-02-02 16:15:36 +00:00
Simon Friis Vindum
9fc2a54712 Rust: Accept changes to expected files for consistency checks 2026-02-02 17:12:25 +01:00
Simon Friis Vindum
d0e30d19c4 Rust: Resolve as paths to trait 2026-02-02 16:47:43 +01:00
Simon Friis Vindum
8de37fec17 Rust: Add tests with as paths 2026-02-02 16:43:21 +01:00
Henry Mercer
e712e62f14 Merge pull request #21250 from github/post-release-prep/codeql-cli-2.24.1
Post-release preparation for codeql-cli-2.24.1
2026-02-02 07:31:39 -08:00
Michael B. Gale
30b30d65c8 Emit the new diagnostic 2026-02-02 14:47:25 +00:00
Michael B. Gale
6d67e419ff Move private registry sources out of util package 2026-02-02 14:45:06 +00:00
Michael B. Gale
29930fa6bf Track active proxy configurations 2026-02-02 14:40:08 +00:00
Michael B. Gale
a57c6cde30 Add EmitPrivateRegistryUsed 2026-02-02 14:39:27 +00:00
Tom Hvitved
b16f1d3778 Rust: Fix bad join
Before
```
Evaluated relational algebra for predicate _PathResolution::ImplItemNode.getTraitPath/0#dispred#3b7d1cb6_PathResolution::ImplOrTraitItemNode.ge__#shared@0d3de6d9 with tuple counts:
         395360270  ~2%    {5} r1 = JOIN Type::TAssociatedTypeTypeParameter#6da9e52a WITH `PathResolution::ImplItemNode.getTraitPath/0#dispred#3b7d1cb6` CARTESIAN PRODUCT OUTPUT Rhs.0, Lhs.0, Lhs.1, Lhs.2, Rhs.1
        1274237644  ~0%    {6}    | JOIN WITH `PathResolution::ItemNode.getASuccessor/1#8f430f71` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Lhs.3, Lhs.4, Rhs.1, Rhs.2
        1274237644  ~0%    {6}    | JOIN WITH PathResolution::TraitItemNode#8d4ce62d ON FIRST 1 OUTPUT Lhs.0, Lhs.4, Lhs.1, Lhs.2, Lhs.3, Lhs.5
           6984871  ~0%    {5}    | JOIN WITH `PathResolution::ImplOrTraitItemNode.getAssocItem/1#f77bb9ed` ON FIRST 3 OUTPUT Lhs.2, Lhs.0, Lhs.3, Lhs.4, Lhs.5
           6984871  ~0%    {4}    | JOIN WITH TypeAlias::Generated::TypeAlias#1ca97780 ON FIRST 1 OUTPUT Lhs.4, Lhs.1, Lhs.2, Lhs.3
           6076675  ~0%    {4}    | JOIN WITH `TypeAlias::Generated::TypeAlias.getTypeRepr/0#dispred#5fd7e521` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3
                           return r1
```

After
```
Evaluated relational algebra for predicate _PathResolution::ImplItemNode.getTraitPath/0#dispred#3b7d1cb6_PathResolution::ImplOrTraitItemNode.ge__#shared@760e0499 with tuple counts:
          443292  ~2%    {3} r1 = SCAN `PathResolution::ImplOrTraitItemNode.getAssocItem/1#f77bb9ed` OUTPUT In.0, In.2, In.1
            1258  ~1%    {3}    | JOIN WITH Type::TAssociatedTypeTypeParameter#6da9e52a ON FIRST 2 OUTPUT Lhs.2, Lhs.0, Rhs.2
        13656944  ~3%    {4}    | JOIN WITH `PathResolution::ItemNode.getASuccessor/1#8f430f71_102#join_rhs` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Rhs.2
         6984871  ~0%    {4}    | JOIN WITH `PathResolution::ImplItemNode.getTraitPath/0#dispred#3b7d1cb6` ON FIRST 1 OUTPUT Lhs.3, Lhs.1, Lhs.2, Rhs.1
         6076675  ~0%    {4}    | JOIN WITH `TypeAlias::Generated::TypeAlias.getTypeRepr/0#dispred#5fd7e521` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.2, Lhs.3
                         return r1
```
2026-02-02 15:26:32 +01:00
github-actions[bot]
73d06f26cb Post-release preparation for codeql-cli-2.24.1 2026-02-02 14:04:26 +00:00
Ben Rodes
7ddfa80399 Merge branch 'main' into azure_python_sdk_url_summary_upstream 2026-02-02 09:00:35 -05:00
Simon Friis Vindum
99b498b891 Rust: Resolve Self paths in type definitions 2026-02-02 13:51:59 +01:00
Simon Friis Vindum
95afe615b5 Rust: Add path resolution tests 2026-02-02 13:51:57 +01:00
Simon Friis Vindum
8b03608a4f Merge pull request #21188 from paldepind/rust/self-path-assoc
Rust: Implement type inference for associated types for concrete types
2026-02-02 13:50:43 +01:00
Simon Friis Vindum
0567864a83 Rust: Make module private
Co-authored-by: Tom Hvitved <hvitved@github.com>
2026-02-02 12:57:26 +01:00
Simon Friis Vindum
18576838d4 Rust: Minor tweaks and improvements 2026-02-02 12:07:18 +01:00
Owen Mansel-Chan
8aa1bff9a5 Add AstNode.getEnclosingBlock() 2026-02-01 23:06:26 +00:00
Taus
958c798c3f Python: Accept dataflow test changes
New nodes means new results. Luckily we rarely have a test that selects
_all_ dataflow nodes.
2026-01-30 12:50:25 +00:00
Taus
fb6175d10b Python: Fix consistency test failures
As we now have many more capturing closure arguments, we must once again
exclude the ones that don't actually have `argumentOf` defined.
2026-01-30 12:50:25 +00:00
Taus
3f718123a6 Python: Make capturing closure arguments synthetic and non-global
Uses the same trick as for `ExtractedArgumentNode`, wherein we postpone
the global restriction on the charpred to instead be in the `argumentOf`
predicate (which is global anyway).

In addition to this, we also converted `CapturedVariablesArgumentNode`
into a proper synthetic node, and added an explicit post-update node for
it. These nodes just act as wrappers for the function part of call
nodes. Thus, to make them work with the variable capture machinery, we
simply map them to the closure node for the corresponding control-flow
or post-update node.
2026-01-30 12:50:25 +00:00
Taus
6113d4be9e Python: Fix test issues
Fixes the test failures that arose from making `ExtractedArgumentNode`
local.

For the consistency checks, we now explicitly exclude the
`ExtractedArgumentNode`s (now much more plentiful due to the
overapproximation) that don't have a corresponding `getCallArg` tuple.

For various queries/tests using `instanceof ArgumentNode`, we instead us
`isArgumentNode`, which explicitly filters out the ones for which
`isArgumentOf` doesn't hold (which, again, is the case for most of the
nodes in the overapproximation).
2026-01-30 12:50:25 +00:00
Taus
7fccc23dbe Python: Make ExtractedArgumentNode local
Explicitly adds a bunch of nodes that were previously (using a global
analysis) identified as `ExtractedArgumentNode`s. These are then
subsequently filtered out in `argumentOf` (which is global) by putting
the call to `getCallArg` there instead of in the charpred.
2026-01-30 12:50:25 +00:00
Taus
ac5a74448f Python: Fix tests
With `ModuleVariableNode`s now appearing for _all_ global variables (not
just the ones that actually seem to be used), some of the tests changed
a bit. Mostly this was in the form of new flow (because of new nodes
that popped into existence). For some inline expectation tests, I opted
to instead exclude these results, as there was no suitable location to
annotate. For the normal tests, I just accepted the output (after having
vetted it carefully, of course).
2026-01-30 12:50:25 +00:00
Taus
30ce4069c7 Python: Remove global restriction on ModuleVariableNode
This may result in more nodes, but it should still be bounded by the
number of global variables in the source code.
2026-01-30 12:50:24 +00:00
Taus
4543c66d26 Python: Prepare LocalSourceNode for locality
Removes the dependence on the (global) `ModuleVariableNode.getARead()`,
by adding a local version (that doesn't include `import *` reads)
instead.
2026-01-30 12:50:24 +00:00
Owen Mansel-Chan
2f29c905c3 Fix typo in change note
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-28 22:39:08 +00:00
Owen Mansel-Chan
e1cf0a15ed Add change note 2026-01-28 22:12:31 +00:00
Owen Mansel-Chan
52c510bfea Use shared getScope instead of getRoot 2026-01-28 22:12:30 +00:00
Owen Mansel-Chan
b2f878229d Use shared getASuccessor and getAPredecessor 2026-01-28 22:12:23 +00:00
Owen Mansel-Chan
3dd6b3fb69 Use shared basic blocks library 2026-01-28 22:11:59 +00:00
Owen Mansel-Chan
c316d51d41 Add ConditionGuardNode.getOutcome 2026-01-28 21:46:26 +00:00
Simon Friis Vindum
2cb0e81da0 Rust: Remove duplicated inclusion of getAdditionalPathTypeAt 2026-01-27 16:17:52 +01:00
Simon Friis Vindum
aae5333325 Rust: Add test with type inference inconsistency 2026-01-27 16:17:51 +01:00
Simon Friis Vindum
fa59a8ae24 Rust: Implement TypeMention for paths that access associated types on concrete types 2026-01-27 16:17:49 +01:00
Simon Friis Vindum
4526afc29f Rust: Paths to associated types resolve to the associated type if implementation is unclear 2026-01-27 16:17:48 +01:00
Owen Mansel-Chan
5bfeede364 Add dependency on shared controlflow library 2026-01-27 09:43:19 +00:00
Simon Friis Vindum
330505c524 Rust: Add tests for associated types 2026-01-26 15:03:07 +01:00
Simon Friis Vindum
01cc19cffc Rust: Add trait visibility test using Self 2026-01-26 12:31:16 +01:00
REDMOND\brodes
26b8a394b3 Adjusting acryonym for SSRF for casing standards. 2025-09-30 14:09:06 -04:00
REDMOND\brodes
a660eaba95 Adding docs. 2025-09-30 14:07:32 -04:00
REDMOND\brodes
acddb2c272 Moved change log to correct location. 2025-09-30 14:02:43 -04:00
Ben Rodes
d790c6df57 Update python/ql/test/query-tests/Security/CWE-918-ServerSideRequestForgery/test_azure_client.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-30 14:00:25 -04:00
Ben Rodes
fab96d9539 Update python/ql/test/query-tests/Security/CWE-918-ServerSideRequestForgery/test_azure_client.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-30 14:00:16 -04:00
Ben Rodes
5ca9ff2082 Update python/ql/lib/semmle/python/frameworks/SSRFSink.qll
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-30 14:00:05 -04:00
REDMOND\brodes
341f553866 Added change logs. 2025-09-30 13:55:31 -04:00
REDMOND\brodes
704e2966cb Adding azure sdk test cases and updated test expected file. 2025-09-30 13:32:56 -04:00
REDMOND\brodes
d27d4fdb27 Updating comments. 2025-09-30 13:31:48 -04:00
REDMOND\brodes
47fac883b8 Azure SDK models for SSRF analysis.
(cherry picked from commit 0274962612c02af09729526a3c44a545c1e69be8)
2025-09-30 11:58:26 -04:00
484 changed files with 112200 additions and 78115 deletions

View File

@@ -254,11 +254,11 @@ use_repo(
)
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.25.0")
go_sdk.download(version = "1.26.0")
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//go/extractor:go.mod")
use_repo(go_deps, "org_golang_x_mod", "org_golang_x_tools")
use_repo(go_deps, "com_github_stretchr_testify", "org_golang_x_mod", "org_golang_x_tools")
ripunzip_archive = use_repo_rule("//misc/ripunzip:ripunzip.bzl", "ripunzip_archive")

View File

@@ -1,3 +1,7 @@
## 0.4.28
No user-facing changes.
## 0.4.27
### Bug Fixes

View File

@@ -0,0 +1,3 @@
## 0.4.28
No user-facing changes.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.4.27
lastReleaseVersion: 0.4.28

View File

@@ -1,5 +1,5 @@
name: codeql/actions-all
version: 0.4.27
version: 0.4.28
library: true
warnOnImplicitThis: true
dependencies:

View File

@@ -1,3 +1,7 @@
## 0.6.20
No user-facing changes.
## 0.6.19
No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 0.6.20
No user-facing changes.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 0.6.19
lastReleaseVersion: 0.6.20

View File

@@ -1,5 +1,5 @@
name: codeql/actions-queries
version: 0.6.19
version: 0.6.20
library: false
warnOnImplicitThis: true
groups: [actions, queries]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
description: Add trap_filename, source_file_uses_trap and in_trap relations
compatibility: full
trap_filename.rel: delete
source_file_uses_trap.rel: delete
in_trap.rel: delete

View File

@@ -1,3 +1,9 @@
## 7.1.1
### Minor Analysis Improvements
* Added remote flow source models for the `winhttp.h` windows header and the Azure SDK core library for C/C++.
## 7.1.0
### New Features

View File

@@ -0,0 +1,5 @@
## 7.1.1
### Minor Analysis Improvements
* Added remote flow source models for the `winhttp.h` windows header and the Azure SDK core library for C/C++.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 7.1.0
lastReleaseVersion: 7.1.1

View File

@@ -24,6 +24,13 @@ extensions:
- ["", "", False, "MapViewOfFileNuma2", "", "", "ReturnValue[*]", "local", "manual"]
# ntifs.h
- ["", "", False, "NtReadFile", "", "", "Argument[*5]", "local", "manual"]
# winhttp.h
- ["", "", False, "WinHttpReadData", "", "", "Argument[*1]", "remote", "manual"]
- ["", "", False, "WinHttpReadDataEx", "", "", "Argument[*1]", "remote", "manual"]
- ["", "", False, "WinHttpQueryHeaders", "", "", "Argument[*3]", "remote", "manual"]
- ["", "", False, "WinHttpQueryHeadersEx", "", "", "Argument[*5]", "remote", "manual"]
- ["", "", False, "WinHttpQueryHeadersEx", "", "", "Argument[*6]", "remote", "manual"]
- ["", "", False, "WinHttpQueryHeadersEx", "", "", "Argument[**8]", "remote", "manual"]
- addsTo:
pack: codeql/cpp-all
extensible: summaryModel
@@ -46,4 +53,6 @@ extensions:
- ["", "", False, "RtlMoveMemory", "", "", "Argument[*@1]", "Argument[*@0]", "value", "manual"]
- ["", "", False, "RtlMoveVolatileMemory", "", "", "Argument[*@1]", "Argument[*@0]", "value", "manual"]
# winternl.h
- ["", "", False, "RtlInitUnicodeString", "", "", "Argument[*1]", "Argument[*0].Field[*Buffer]", "value", "manual"]
- ["", "", False, "RtlInitUnicodeString", "", "", "Argument[*1]", "Argument[*0].Field[*Buffer]", "value", "manual"]
# winhttp.h
- ["", "", False, "WinHttpCrackUrl", "", "", "Argument[*0]", "Argument[*3]", "taint", "manual"]

View File

@@ -0,0 +1,41 @@
extensions:
- addsTo:
pack: codeql/cpp-all
extensible: sourceModel
data: # namespace, type, subtypes, name, signature, ext, output, kind, provenance
- ["Azure::Core::Http", "RawResponse", True, "GetHeaders", "", "", "ReturnValue[*]", "remote", "manual"]
- ["Azure::Core::Http", "RawResponse", True, "GetBody", "", "", "ReturnValue[*]", "remote", "manual"]
- ["Azure::Core::Http", "RawResponse", True, "ExtractBodyStream", "", "", "ReturnValue[*]", "remote", "manual"]
- ["Azure::Core::Http", "Request", True, "GetHeaders", "", "", "ReturnValue", "remote", "manual"]
- ["Azure::Core::Http", "Request", True, "GetHeader", "", "", "ReturnValue", "remote", "manual"]
- ["Azure::Core::Http", "Request", True, "GetBodyStream", "", "", "ReturnValue[*]", "remote", "manual"]
- addsTo:
pack: codeql/cpp-all
extensible: summaryModel
data: # namespace, type, subtypes, name, signature, ext, input, output, kind, provenance
- ["Azure::Core", "Url", True, "Url", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]
- ["Azure::Core", "Url", True, "SetScheme", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]
- ["Azure::Core", "Url", True, "SetHost", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]
- ["Azure::Core", "Url", True, "SetPort", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["Azure::Core", "Url", True, "SetPath", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]
- ["Azure::Core", "Url", True, "SetQueryParameters", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["Azure::Core", "Url", True, "AppendPath", "", "", "Argument[*0]", "Argument[-1]", "taint", "manual"]
- ["Azure::Core", "Url", True, "AppendQueryParameter", "", "", "Argument[*1]", "Argument[-1]", "taint", "manual"]
- ["Azure::Core", "Url", True, "GetHost", "", "", "Argument[-1]", "ReturnValue[*]", "taint", "manual"]
- ["Azure::Core", "Url", True, "GetPath", "", "", "Argument[-1]", "ReturnValue[*]", "taint", "manual"]
- ["Azure::Core", "Url", True, "GetPort", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["Azure::Core", "Url", True, "GetQueryParameters", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["Azure::Core", "Url", True, "GetScheme", "", "", "Argument[-1]", "ReturnValue[*]", "taint", "manual"]
- ["Azure::Core", "Url", True, "GetRelativeUrl", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["Azure::Core", "Url", True, "GetAbsoluteUrl", "", "", "Argument[-1]", "ReturnValue", "taint", "manual"]
- ["Azure::Core", "Url", True, "Decode", "", "", "Argument[*0]", "ReturnValue", "taint", "manual"]
- ["Azure::Core", "Url", True, "Encode", "", "", "Argument[*0]", "ReturnValue", "taint", "manual"]
- ["Azure::Core::IO", "BodyStream", True, "Read", "", "", "Argument[-1]", "Argument[*0]", "taint", "manual"]
- ["Azure::Core::IO", "BodyStream", True, "ReadToCount", "", "", "Argument[-1]", "Argument[*0]", "taint", "manual"]
- ["Azure::Core::IO", "BodyStream", True, "ReadToEnd", "", "", "Argument[-1]", "ReturnValue.Element", "taint", "manual"]
- ["Azure", "Nullable", True, "Nullable", "", "", "Argument[0]", "Argument[-1]", "taint", "manual"]
- ["Azure", "Nullable", True, "operator=", "", "", "Argument[*0]", "Argument[-1]", "value", "manual"]
- ["Azure", "Nullable", True, "Value", "", "", "Argument[-1]", "ReturnValue[*]", "taint", "manual"]
- ["Azure", "Nullable", True, "operator->", "", "", "Argument[-1]", "ReturnValue[*]", "taint", "manual"]
- ["Azure", "Nullable", True, "operator*", "", "", "Argument[-1]", "ReturnValue[*]", "taint", "manual"]

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-all
version: 7.1.0
version: 7.1.1
groups: cpp
dbscheme: semmlecode.cpp.dbscheme
extractor: cpp

View File

@@ -64,17 +64,27 @@ private string getMultiLocationFilePath(@element e) {
overlay[local]
private predicate isBase() { not isOverlay() }
/**
* Holds if `path` was extracted in the overlay database.
*/
overlay[local]
private predicate overlayHasFile(string path) {
isOverlay() and
files(_, path) and
path != ""
}
/**
* Discards an element from the base variant if:
* - It has a single location in a changed file, or
* - All of its locations are in changed files.
* - It has a single location in a file extracted in the overlay, or
* - All of its locations are in files extracted in the overlay.
*/
overlay[discard_entity]
private predicate discardElement(@element e) {
isBase() and
(
overlayChangedFiles(getSingleLocationFilePath(e))
overlayHasFile(getSingleLocationFilePath(e))
or
forex(string path | path = getMultiLocationFilePath(e) | overlayChangedFiles(path))
forex(string path | path = getMultiLocationFilePath(e) | overlayHasFile(path))
)
}

View File

@@ -1726,9 +1726,7 @@ private module Cached {
SsaImpl::ssaFlow(n, succ) and
bb1 = n.getBasicBlock() and
bb2 = succ.getBasicBlock() and
bb1 != bb2 and
bb2.dominates(bb1) and
bb1.getASuccessor+() = bb2
bb2.strictlyDominates(bb1)
)
}

View File

@@ -390,7 +390,7 @@ class TranslatedDeclStmt extends TranslatedStmt {
override TranslatedElement getLastChild() { result = this.getChild(this.getChildCount() - 1) }
private int getChildCount() { result = count(this.getDeclarationEntry(_)) }
private int getChildCount() { result = count(int i | exists(this.getDeclarationEntry(i))) }
IRDeclarationEntry getIRDeclarationEntry(int index) {
result.hasIndex(index) and

View File

@@ -57,3 +57,4 @@ private import implementations.CAtlFile
private import implementations.CAtlFileMapping
private import implementations.CAtlTemporaryFile
private import implementations.CRegKey
private import implementations.WinHttp

View File

@@ -0,0 +1,50 @@
private import cpp
private import semmle.code.cpp.ir.dataflow.FlowSteps
private import semmle.code.cpp.dataflow.new.DataFlow
/** The `WINHTTP_HEADER_NAME` class from `winhttp.h`. */
class WinHttpHeaderName extends Class {
WinHttpHeaderName() { this.hasGlobalName("_WINHTTP_HEADER_NAME") }
}
/** The `WINHTTP_EXTENDED_HEADER` class from `winhttp.h`. */
class WinHttpExtendedHeader extends Class {
WinHttpExtendedHeader() { this.hasGlobalName("_WINHTTP_EXTENDED_HEADER") }
}
private class WinHttpHeaderNameInheritingContent extends TaintInheritingContent,
DataFlow::FieldContent
{
WinHttpHeaderNameInheritingContent() {
this.getIndirectionIndex() = 2 and
(
this.getAField().getDeclaringType() instanceof WinHttpHeaderName
or
// The extended header looks like:
// struct WINHTTP_EXTENDED_HEADER {
// union { [...] };
// union { [...] };
// };
// So the first declaring type is the anonymous unions, and the declaring
// type of those anonymous unions is the `WINHTTP_EXTENDED_HEADER` struct.
this.getAField().getDeclaringType().getDeclaringType() instanceof WinHttpExtendedHeader
)
}
}
/** The `URL_COMPONENTS` class from `winhttp.h`. */
class WinHttpUrlComponents extends Class {
WinHttpUrlComponents() { this.hasGlobalName("_WINHTTP_URL_COMPONENTS") }
}
private class WinHttpUrlComponentsInheritingContent extends TaintInheritingContent,
DataFlow::FieldContent
{
WinHttpUrlComponentsInheritingContent() {
exists(Field f | f = this.getField() and f.getDeclaringType() instanceof WinHttpUrlComponents |
if f.getType().getUnspecifiedType() instanceof PointerType
then this.getIndirectionIndex() = 2
else this.getIndirectionIndex() = 1
)
}
}

View File

@@ -404,7 +404,7 @@ predicate cmpWithLinearBound(
* For example, if `t` is a signed 32-bit type then holds if `lb` is
* `-2^31` and `ub` is `2^31 - 1`.
*/
private predicate typeBounds(ArithmeticType t, float lb, float ub) {
private predicate typeBounds0(ArithmeticType t, float lb, float ub) {
exists(IntegralType integralType, float limit |
integralType = t and limit = 2.pow(8 * integralType.getSize())
|
@@ -423,6 +423,42 @@ private predicate typeBounds(ArithmeticType t, float lb, float ub) {
t instanceof FloatingPointType and lb = -(1.0 / 0.0) and ub = 1.0 / 0.0
}
/**
* Gets the underlying type for an enumeration `e`.
*
* If the enumeration does not have an explicit type we approximate it using
* the following rules:
* - The result type is always `signed`, and
* - if the largest value fits in an `int` the result is `int`. Otherwise, the
* result is `long`.
*/
private IntegralType getUnderlyingTypeForEnum(Enum e) {
result = e.getExplicitUnderlyingType()
or
not e.hasExplicitUnderlyingType() and
result.isSigned() and
exists(IntType intType |
if max(e.getAnEnumConstant().getValue().toFloat()) >= 2.pow(8 * intType.getSize() - 1)
then result instanceof LongType
else result = intType
)
}
/**
* Holds if `lb` and `ub` are the lower and upper bounds of the unspecified
* type `t`.
*
* For example, if `t` is a signed 32-bit type then holds if `lb` is
* `-2^31` and `ub` is `2^31 - 1`.
*
* Unlike `typeBounds0`, this predicate also handles `Enum` types.
*/
private predicate typeBounds(Type t, float lb, float ub) {
typeBounds0(t, lb, ub)
or
typeBounds0(getUnderlyingTypeForEnum(t), lb, ub)
}
private Type stripReference(Type t) {
if t instanceof ReferenceType then result = t.(ReferenceType).getBaseType() else result = t
}

View File

@@ -512,8 +512,8 @@ private module BoundsEstimate {
*/
float getBoundsLimit() {
// This limit is arbitrary, but low enough that it prevents timeouts on
// specific observed customer databases (and the in the tests).
result = 2.0.pow(40)
// specific observed customer databases (and in the tests).
result = 2.0.pow(29)
}
/** Gets the maximum number of bounds possible for `t` when widening is used. */

View File

@@ -236,6 +236,34 @@ extractor_version(
string frontend_version: string ref
)
/**
* Gives the TRAP filename that `trap` is associated with.
* For debugging only.
*/
trap_filename(
int trap: @trap,
string filename: string ref
);
/**
* In `build-mode: none` overlay mode, indicates that `source_file`
* (`/path/to/foo.c`) uses the TRAP file `trap_file`; i.e. it is the
* TRAP file corresponding to `foo.c`, something it transitively
* includes, or a template instantiation it transitively uses.
*/
source_file_uses_trap(
string source_file: string ref,
int trap_file: @trap ref
);
/**
* Holds if there is a definition of `element` in TRAP file `trap_file`.
*/
in_trap(
int element: @element ref,
int trap_file: @trap ref
);
pch_uses(
int pch: @pch ref,
int compilation: @compilation ref,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Add trap_filename, source_file_uses_trap and in_trap relations
compatibility: full

View File

@@ -1,3 +1,7 @@
## 1.5.11
No user-facing changes.
## 1.5.10
No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 1.5.11
No user-facing changes.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.5.10
lastReleaseVersion: 1.5.11

View File

@@ -1,5 +1,5 @@
name: codeql/cpp-queries
version: 1.5.10
version: 1.5.11
groups:
- cpp
- queries

View File

@@ -0,0 +1,297 @@
using uint16_t = unsigned short;
using int64_t = long long;
using size_t = unsigned long;
using uint8_t = unsigned char;
using int32_t = int;
using uint32_t = unsigned int;
namespace std
{
class string
{
public:
string();
string(const char *);
~string();
};
template <typename K, typename V>
class map
{
public:
map();
~map();
V& operator[](const K& key);
};
template <typename T>
class vector
{
public:
vector();
~vector();
T& operator[](size_t);
};
template<typename T>
class unique_ptr {
public:
unique_ptr();
~unique_ptr();
T* get();
};
}
namespace Azure
{
template <typename T>
class Nullable
{
public:
Nullable();
Nullable(const T);
Nullable(const Nullable &);
~Nullable();
Nullable (Nullable &&);
Nullable & operator= (const Nullable &);
bool HasValue() const;
const T & Value () const;
T& Value ();
const T * operator-> () const;
T * operator-> ();
const T & operator* () const;
T & operator* ();
};
namespace Core
{
class Url
{
public:
Url();
Url(const std::string &);
void AppendPath(const std::string &encodedPath);
void AppendQueryParameter(const std::string &encodedKey,
const std::string &encodedValue);
static std::string Url::Decode(const std::string &value);
static std::string Url::Encode(const std::string &value,
const std::string &doNotEncodeSymbols = "");
std::string Url::GetAbsoluteUrl() const;
const std::string &GetHost() const;
const std::string &GetPath() const;
uint16_t GetPort() const;
std::map<std::string, std::string> GetQueryParameters() const;
std::string Url::GetRelativeUrl() const;
const std::string &GetScheme() const;
void RemoveQueryParameter(const std::string &encodedKey);
void SetHost(const std::string &encodedHost);
void SetPath(const std::string &encodedPath);
void SetPort(uint16_t port);
void SetQueryParameters(std::map<std::string, std::string> queryParameters);
void SetScheme(const std::string &scheme);
};
class Context
{
public:
Context();
};
namespace IO
{
class BodyStream
{
public:
virtual ~BodyStream();
virtual int64_t Length() const = 0;
virtual void Rewind();
size_t Read(uint8_t *buffer, size_t count, Azure::Core::Context const &context = Azure::Core::Context());
size_t ReadToCount(uint8_t *buffer, size_t count, Azure::Core::Context const &context = Azure::Core::Context());
std::vector<uint8_t> ReadToEnd(Azure::Core::Context const &context = Azure::Core::Context());
};
}
enum class HttpStatusCode {
None = 0,
Continue = 100,
SwitchingProtocols = 101,
Processing = 102,
EarlyHints = 103,
OK = 200,
Created = 201,
Accepted = 202,
NonAuthoritativeInformation = 203,
NoContent = 204,
ResetContent = 205,
PartialContent = 206,
MultiStatus = 207,
AlreadyReported = 208,
IMUsed = 226,
MultipleChoices = 300,
MovedPermanently = 301,
Found = 302,
SeeOther = 303,
NotModified = 304,
UseProxy = 305,
TemporaryRedirect = 307,
PermanentRedirect = 308,
BadRequest = 400,
Unauthorized = 401,
PaymentRequired = 402,
Forbidden = 403,
NotFound = 404,
MethodNotAllowed = 405,
NotAcceptable = 406,
ProxyAuthenticationRequired = 407,
RequestTimeout = 408,
Conflict = 409,
Gone = 410,
LengthRequired = 411,
PreconditionFailed = 412,
PayloadTooLarge = 413,
URITooLong = 414,
UnsupportedMediaType = 415,
RangeNotSatisfiable = 416,
ExpectationFailed = 417,
MisdirectedRequest = 421,
UnprocessableEntity = 422,
Locked = 423,
FailedDependency = 424,
TooEarly = 425,
UpgradeRequired = 426,
PreconditionRequired = 428,
TooManyRequests = 429,
RequestHeaderFieldsTooLarge = 431,
UnavailableForLegalReasons = 451,
InternalServerError = 500,
NotImplemented = 501,
BadGateway = 502,
ServiceUnavailable = 503,
GatewayTimeout = 504,
HTTPVersionNotSupported = 505,
VariantAlsoNegotiates = 506,
InsufficientStorage = 507,
LoopDetected = 508,
NotExtended = 510,
NetworkAuthenticationRequired = 511
};
namespace Http
{
class HttpMethod
{
public:
HttpMethod(std::string value);
bool operator==(const HttpMethod &other) const;
bool operator!=(const HttpMethod &other) const;
const std::string &ToString() const;
};
extern const HttpMethod Get;
extern const HttpMethod Head;
extern const HttpMethod Post;
extern const HttpMethod Put;
extern const HttpMethod Delete;
extern const HttpMethod Patch;
extern const HttpMethod Options;
class Request
{
public:
explicit Request(HttpMethod httpMethod,
Url url);
explicit Request(HttpMethod httpMethod,
Url url,
bool shouldBufferResponse);
explicit Request(HttpMethod httpMethod,
Url url,
IO::BodyStream *bodyStream);
explicit Request(HttpMethod httpMethod,
Url url,
IO::BodyStream *bodyStream,
bool shouldBufferResponse);
std::map<std::string, std::string> GetHeaders () const;
Azure::Nullable<std::string> GetHeader(std::string const &name);
IO::BodyStream * GetBodyStream();
Azure::Core::IO::BodyStream const* GetBodyStream () const;
};
class RawResponse {
public:
RawResponse (int32_t majorVersion, int32_t minorVersion, HttpStatusCode statusCode, std::string const &reasonPhrase);
RawResponse (RawResponse const &response);
RawResponse (RawResponse &&response);
~RawResponse ();
void SetHeader (std::string const &name, std::string const &value);
void SetBodyStream (std::unique_ptr< Azure::Core::IO::BodyStream > stream);
void SetBody (std::vector< uint8_t > body);
uint32_t GetMajorVersion () const;
uint32_t GetMinorVersion () const;
HttpStatusCode GetStatusCode () const;
std::string const & GetReasonPhrase () const;
std::map<std::string, std::string>& GetHeaders () const;
std::unique_ptr<Azure::Core::IO::BodyStream> ExtractBodyStream ();
std::vector<uint8_t> & GetBody ();
std::vector<uint8_t> const& GetBody() const;
};
}
}
}
void sink(char);
void sink(std::string);
void sink(std::vector<uint8_t>);
void sink(Azure::Nullable<std::string>);
void test_BodyStream() {
Azure::Core::Http::Request request(Azure::Core::Http::Get, Azure::Core::Url("http://example.com"));
Azure::Core::IO::BodyStream * resp = request.GetBodyStream();
{
unsigned char buffer[1024];
resp->Read(buffer, sizeof(buffer));
sink(*buffer); // $ ir
}
{
unsigned char buffer[1024];
resp->ReadToCount(buffer, sizeof(buffer));
sink(*buffer); // $ ir
}
{
std::vector<unsigned char> vec = resp->ReadToEnd();
sink(vec); // $ ir
}
}
void test_RawResponse(Azure::Core::Http::RawResponse& resp) {
{
std::map<std::string, std::string> body = resp.GetHeaders();
sink(body["Content-Type"]); // $ ir
}
{
std::vector<uint8_t> body = resp.GetBody();
sink(body); // $ ir
}
{
std::unique_ptr<Azure::Core::IO::BodyStream> bodyStream = resp.ExtractBodyStream();
sink(bodyStream.get()->ReadToEnd()); // $ ir
}
}
void test_GetHeader() {
Azure::Core::Http::Request request(Azure::Core::Http::Get, Azure::Core::Url("http://example.com"));
{
auto headerValue = request.GetHeader("Content-Type").Value();
sink(headerValue); // $ ir
}
{
std::map<std::string, std::string> headers = request.GetHeaders();
std::string contentType = headers["Content-Type"];
sink(contentType); // $ ir
}
}

View File

@@ -14,45 +14,111 @@ models
| 13 | Source: ; ; false; NtReadFile; ; ; Argument[*5]; local; manual |
| 14 | Source: ; ; false; ReadFile; ; ; Argument[*1]; local; manual |
| 15 | Source: ; ; false; ReadFileEx; ; ; Argument[*1]; local; manual |
| 16 | Source: ; ; false; ymlSource; ; ; ReturnValue; local; manual |
| 17 | Source: boost::asio; ; false; read_until; ; ; Argument[*1]; remote; manual |
| 18 | Summary: ; ; false; CommandLineToArgvA; ; ; Argument[*0]; ReturnValue[**]; taint; manual |
| 19 | Summary: ; ; false; CreateRemoteThread; ; ; Argument[@4]; Argument[3].Parameter[@0]; value; manual |
| 20 | Summary: ; ; false; CreateRemoteThreadEx; ; ; Argument[@4]; Argument[3].Parameter[@0]; value; manual |
| 21 | Summary: ; ; false; CreateThread; ; ; Argument[@3]; Argument[2].Parameter[@0]; value; manual |
| 22 | Summary: ; ; false; ReadFileEx; ; ; Argument[*3].Field[@hEvent]; Argument[4].Parameter[*2].Field[@hEvent]; value; manual |
| 23 | Summary: ; ; false; RtlCopyDeviceMemory; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 24 | Summary: ; ; false; RtlCopyMemory; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 25 | Summary: ; ; false; RtlCopyMemoryNonTemporal; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 26 | Summary: ; ; false; RtlCopyUnicodeString; ; ; Argument[*1].Field[*Buffer]; Argument[*0].Field[*Buffer]; value; manual |
| 27 | Summary: ; ; false; RtlCopyVolatileMemory; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 28 | Summary: ; ; false; RtlInitUnicodeString; ; ; Argument[*1]; Argument[*0].Field[*Buffer]; value; manual |
| 29 | Summary: ; ; false; RtlMoveMemory; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 30 | Summary: ; ; false; RtlMoveVolatileMemory; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 31 | Summary: ; ; false; callWithArgument; ; ; Argument[1]; Argument[0].Parameter[0]; value; manual |
| 32 | Summary: ; ; false; callWithNonTypeTemplate<T>; (const T &); ; Argument[*0]; ReturnValue; value; manual |
| 33 | Summary: ; ; false; pthread_create; ; ; Argument[@3]; Argument[2].Parameter[@0]; value; manual |
| 34 | Summary: ; ; false; ymlStepGenerated; ; ; Argument[0]; ReturnValue; taint; df-generated |
| 35 | Summary: ; ; false; ymlStepManual; ; ; Argument[0]; ReturnValue; taint; manual |
| 36 | Summary: ; ; false; ymlStepManual_with_body; ; ; Argument[0]; ReturnValue; taint; manual |
| 37 | Summary: boost::asio; ; false; buffer; ; ; Argument[*0]; ReturnValue; taint; manual |
| 16 | Source: ; ; false; WinHttpQueryHeaders; ; ; Argument[*3]; remote; manual |
| 17 | Source: ; ; false; WinHttpQueryHeadersEx; ; ; Argument[**8]; remote; manual |
| 18 | Source: ; ; false; WinHttpQueryHeadersEx; ; ; Argument[*5]; remote; manual |
| 19 | Source: ; ; false; WinHttpQueryHeadersEx; ; ; Argument[*6]; remote; manual |
| 20 | Source: ; ; false; WinHttpReadData; ; ; Argument[*1]; remote; manual |
| 21 | Source: ; ; false; WinHttpReadDataEx; ; ; Argument[*1]; remote; manual |
| 22 | Source: ; ; false; ymlSource; ; ; ReturnValue; local; manual |
| 23 | Source: Azure::Core::Http; RawResponse; true; ExtractBodyStream; ; ; ReturnValue[*]; remote; manual |
| 24 | Source: Azure::Core::Http; RawResponse; true; GetBody; ; ; ReturnValue[*]; remote; manual |
| 25 | Source: Azure::Core::Http; RawResponse; true; GetHeaders; ; ; ReturnValue[*]; remote; manual |
| 26 | Source: Azure::Core::Http; Request; true; GetBodyStream; ; ; ReturnValue[*]; remote; manual |
| 27 | Source: Azure::Core::Http; Request; true; GetHeader; ; ; ReturnValue; remote; manual |
| 28 | Source: Azure::Core::Http; Request; true; GetHeaders; ; ; ReturnValue; remote; manual |
| 29 | Source: boost::asio; ; false; read_until; ; ; Argument[*1]; remote; manual |
| 30 | Summary: ; ; false; CommandLineToArgvA; ; ; Argument[*0]; ReturnValue[**]; taint; manual |
| 31 | Summary: ; ; false; CreateRemoteThread; ; ; Argument[@4]; Argument[3].Parameter[@0]; value; manual |
| 32 | Summary: ; ; false; CreateRemoteThreadEx; ; ; Argument[@4]; Argument[3].Parameter[@0]; value; manual |
| 33 | Summary: ; ; false; CreateThread; ; ; Argument[@3]; Argument[2].Parameter[@0]; value; manual |
| 34 | Summary: ; ; false; ReadFileEx; ; ; Argument[*3].Field[@hEvent]; Argument[4].Parameter[*2].Field[@hEvent]; value; manual |
| 35 | Summary: ; ; false; RtlCopyDeviceMemory; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 36 | Summary: ; ; false; RtlCopyMemory; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 37 | Summary: ; ; false; RtlCopyMemoryNonTemporal; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 38 | Summary: ; ; false; RtlCopyUnicodeString; ; ; Argument[*1].Field[*Buffer]; Argument[*0].Field[*Buffer]; value; manual |
| 39 | Summary: ; ; false; RtlCopyVolatileMemory; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 40 | Summary: ; ; false; RtlInitUnicodeString; ; ; Argument[*1]; Argument[*0].Field[*Buffer]; value; manual |
| 41 | Summary: ; ; false; RtlMoveMemory; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 42 | Summary: ; ; false; RtlMoveVolatileMemory; ; ; Argument[*@1]; Argument[*@0]; value; manual |
| 43 | Summary: ; ; false; WinHttpCrackUrl; ; ; Argument[*0]; Argument[*3]; taint; manual |
| 44 | Summary: ; ; false; callWithArgument; ; ; Argument[1]; Argument[0].Parameter[0]; value; manual |
| 45 | Summary: ; ; false; callWithNonTypeTemplate<T>; (const T &); ; Argument[*0]; ReturnValue; value; manual |
| 46 | Summary: ; ; false; pthread_create; ; ; Argument[@3]; Argument[2].Parameter[@0]; value; manual |
| 47 | Summary: ; ; false; ymlStepGenerated; ; ; Argument[0]; ReturnValue; taint; df-generated |
| 48 | Summary: ; ; false; ymlStepManual; ; ; Argument[0]; ReturnValue; taint; manual |
| 49 | Summary: ; ; false; ymlStepManual_with_body; ; ; Argument[0]; ReturnValue; taint; manual |
| 50 | Summary: Azure::Core::IO; BodyStream; true; Read; ; ; Argument[-1]; Argument[*0]; taint; manual |
| 51 | Summary: Azure::Core::IO; BodyStream; true; ReadToCount; ; ; Argument[-1]; Argument[*0]; taint; manual |
| 52 | Summary: Azure::Core::IO; BodyStream; true; ReadToEnd; ; ; Argument[-1]; ReturnValue.Element; taint; manual |
| 53 | Summary: Azure; Nullable; true; Value; ; ; Argument[-1]; ReturnValue[*]; taint; manual |
| 54 | Summary: boost::asio; ; false; buffer; ; ; Argument[*0]; ReturnValue; taint; manual |
edges
| asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | provenance | MaD:37 |
| asio_streams.cpp:87:34:87:44 | read_until output argument | asio_streams.cpp:91:7:91:17 | recv_buffer | provenance | Src:MaD:17 |
| asio_streams.cpp:87:34:87:44 | read_until output argument | asio_streams.cpp:93:29:93:39 | *recv_buffer | provenance | Src:MaD:17 Sink:MaD:2 |
| asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | provenance | MaD:54 |
| asio_streams.cpp:87:34:87:44 | read_until output argument | asio_streams.cpp:91:7:91:17 | recv_buffer | provenance | Src:MaD:29 |
| asio_streams.cpp:87:34:87:44 | read_until output argument | asio_streams.cpp:93:29:93:39 | *recv_buffer | provenance | Src:MaD:29 Sink:MaD:2 |
| asio_streams.cpp:97:37:97:44 | call to source | asio_streams.cpp:98:7:98:14 | send_str | provenance | TaintFunction |
| asio_streams.cpp:97:37:97:44 | call to source | asio_streams.cpp:100:64:100:71 | *send_str | provenance | TaintFunction |
| asio_streams.cpp:100:44:100:62 | call to buffer | asio_streams.cpp:100:44:100:62 | call to buffer | provenance | |
| asio_streams.cpp:100:44:100:62 | call to buffer | asio_streams.cpp:101:7:101:17 | send_buffer | provenance | |
| asio_streams.cpp:100:44:100:62 | call to buffer | asio_streams.cpp:103:29:103:39 | *send_buffer | provenance | Sink:MaD:2 |
| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | provenance | |
| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:100:44:100:62 | call to buffer | provenance | MaD:37 |
| test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | test.cpp:4:5:4:17 | [summary] to write: ReturnValue in ymlStepManual | provenance | MaD:35 |
| test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | test.cpp:5:5:5:20 | [summary] to write: ReturnValue in ymlStepGenerated | provenance | MaD:34 |
| test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | test.cpp:6:5:6:27 | [summary] to write: ReturnValue in ymlStepManual_with_body | provenance | MaD:36 |
| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:100:44:100:62 | call to buffer | provenance | MaD:54 |
| azure.cpp:62:10:62:14 | [summary param] this in Value | azure.cpp:62:10:62:14 | [summary] to write: ReturnValue[*] in Value | provenance | MaD:53 |
| azure.cpp:113:16:113:19 | [summary param] this in Read | azure.cpp:113:16:113:19 | [summary param] *0 in Read [Return] | provenance | MaD:50 |
| azure.cpp:114:16:114:26 | [summary param] this in ReadToCount | azure.cpp:114:16:114:26 | [summary param] *0 in ReadToCount [Return] | provenance | MaD:51 |
| azure.cpp:115:30:115:38 | [summary param] this in ReadToEnd | azure.cpp:115:30:115:38 | [summary] to write: ReturnValue.Element in ReadToEnd | provenance | MaD:52 |
| azure.cpp:115:30:115:38 | [summary] to write: ReturnValue.Element in ReadToEnd | azure.cpp:115:30:115:38 | [summary] to write: ReturnValue in ReadToEnd [element] | provenance | |
| azure.cpp:253:48:253:60 | *call to GetBodyStream | azure.cpp:253:48:253:60 | *call to GetBodyStream | provenance | Src:MaD:26 |
| azure.cpp:253:48:253:60 | *call to GetBodyStream | azure.cpp:257:5:257:8 | *resp | provenance | |
| azure.cpp:253:48:253:60 | *call to GetBodyStream | azure.cpp:262:5:262:8 | *resp | provenance | |
| azure.cpp:253:48:253:60 | *call to GetBodyStream | azure.cpp:266:38:266:41 | *resp | provenance | |
| azure.cpp:257:5:257:8 | *resp | azure.cpp:113:16:113:19 | [summary param] this in Read | provenance | |
| azure.cpp:257:5:257:8 | *resp | azure.cpp:257:16:257:21 | Read output argument | provenance | MaD:50 |
| azure.cpp:257:16:257:21 | Read output argument | azure.cpp:258:10:258:16 | * ... | provenance | |
| azure.cpp:262:5:262:8 | *resp | azure.cpp:114:16:114:26 | [summary param] this in ReadToCount | provenance | |
| azure.cpp:262:5:262:8 | *resp | azure.cpp:262:23:262:28 | ReadToCount output argument | provenance | MaD:51 |
| azure.cpp:262:23:262:28 | ReadToCount output argument | azure.cpp:263:10:263:16 | * ... | provenance | |
| azure.cpp:266:38:266:41 | *resp | azure.cpp:115:30:115:38 | [summary param] this in ReadToEnd | provenance | |
| azure.cpp:266:38:266:41 | *resp | azure.cpp:266:44:266:52 | call to ReadToEnd [element] | provenance | MaD:52 |
| azure.cpp:266:44:266:52 | call to ReadToEnd [element] | azure.cpp:266:44:266:52 | call to ReadToEnd [element] | provenance | |
| azure.cpp:266:44:266:52 | call to ReadToEnd [element] | azure.cpp:267:10:267:12 | vec [element] | provenance | |
| azure.cpp:267:10:267:12 | vec [element] | azure.cpp:267:10:267:12 | vec | provenance | |
| azure.cpp:273:62:273:64 | call to GetHeaders | azure.cpp:273:62:273:64 | call to GetHeaders | provenance | Src:MaD:25 |
| azure.cpp:273:62:273:64 | call to GetHeaders | azure.cpp:274:14:274:29 | call to operator[] | provenance | TaintFunction |
| azure.cpp:273:62:273:64 | call to GetHeaders | azure.cpp:274:14:274:29 | call to operator[] | provenance | TaintFunction |
| azure.cpp:273:62:273:64 | call to GetHeaders | azure.cpp:274:14:274:29 | call to operator[] | provenance | TaintFunction |
| azure.cpp:274:14:274:29 | call to operator[] | azure.cpp:274:10:274:29 | call to operator[] | provenance | |
| azure.cpp:274:14:274:29 | call to operator[] | azure.cpp:274:14:274:29 | call to operator[] | provenance | |
| azure.cpp:277:45:277:47 | call to GetBody | azure.cpp:277:45:277:47 | call to GetBody | provenance | Src:MaD:24 |
| azure.cpp:277:45:277:47 | call to GetBody | azure.cpp:278:10:278:13 | body | provenance | |
| azure.cpp:277:45:277:47 | call to GetBody | azure.cpp:278:10:278:13 | body | provenance | |
| azure.cpp:278:10:278:13 | body | azure.cpp:278:10:278:13 | body | provenance | |
| azure.cpp:281:68:281:84 | *call to ExtractBodyStream | azure.cpp:281:68:281:84 | *call to ExtractBodyStream | provenance | Src:MaD:23 |
| azure.cpp:281:68:281:84 | *call to ExtractBodyStream | azure.cpp:282:21:282:23 | *call to get | provenance | |
| azure.cpp:282:21:282:23 | *call to get | azure.cpp:115:30:115:38 | [summary param] this in ReadToEnd | provenance | |
| azure.cpp:282:21:282:23 | *call to get | azure.cpp:282:28:282:36 | call to ReadToEnd [element] | provenance | MaD:52 |
| azure.cpp:282:28:282:36 | call to ReadToEnd [element] | azure.cpp:282:10:282:38 | call to ReadToEnd | provenance | |
| azure.cpp:282:28:282:36 | call to ReadToEnd [element] | azure.cpp:282:28:282:36 | call to ReadToEnd [element] | provenance | |
| azure.cpp:289:24:289:56 | call to GetHeader | azure.cpp:62:10:62:14 | [summary param] this in Value | provenance | |
| azure.cpp:289:24:289:56 | call to GetHeader | azure.cpp:289:63:289:65 | call to Value | provenance | MaD:53 |
| azure.cpp:289:32:289:40 | call to GetHeader | azure.cpp:289:24:289:56 | call to GetHeader | provenance | |
| azure.cpp:289:32:289:40 | call to GetHeader | azure.cpp:289:32:289:40 | call to GetHeader | provenance | Src:MaD:27 |
| azure.cpp:289:63:289:65 | call to Value | azure.cpp:289:63:289:65 | call to Value | provenance | |
| azure.cpp:289:63:289:65 | call to Value | azure.cpp:290:10:290:20 | headerValue | provenance | |
| azure.cpp:289:63:289:65 | call to Value | azure.cpp:290:10:290:20 | headerValue | provenance | |
| azure.cpp:290:10:290:20 | headerValue | azure.cpp:290:10:290:20 | headerValue | provenance | |
| azure.cpp:293:58:293:67 | call to GetHeaders | azure.cpp:293:58:293:67 | call to GetHeaders | provenance | Src:MaD:28 |
| azure.cpp:293:58:293:67 | call to GetHeaders | azure.cpp:294:38:294:53 | call to operator[] | provenance | TaintFunction |
| azure.cpp:294:38:294:53 | call to operator[] | azure.cpp:295:10:295:20 | contentType | provenance | |
| azure.cpp:294:38:294:53 | call to operator[] | azure.cpp:295:10:295:20 | contentType | provenance | |
| azure.cpp:295:10:295:20 | contentType | azure.cpp:295:10:295:20 | contentType | provenance | |
| test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | test.cpp:4:5:4:17 | [summary] to write: ReturnValue in ymlStepManual | provenance | MaD:48 |
| test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | test.cpp:5:5:5:20 | [summary] to write: ReturnValue in ymlStepGenerated | provenance | MaD:47 |
| test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | test.cpp:6:5:6:27 | [summary] to write: ReturnValue in ymlStepManual_with_body | provenance | MaD:49 |
| test.cpp:7:47:7:52 | value2 | test.cpp:7:64:7:69 | value2 | provenance | |
| test.cpp:7:64:7:69 | value2 | test.cpp:7:5:7:30 | *ymlStepGenerated_with_body | provenance | |
| test.cpp:10:10:10:18 | call to ymlSource | test.cpp:10:10:10:18 | call to ymlSource | provenance | Src:MaD:16 |
| test.cpp:10:10:10:18 | call to ymlSource | test.cpp:10:10:10:18 | call to ymlSource | provenance | Src:MaD:22 |
| test.cpp:10:10:10:18 | call to ymlSource | test.cpp:14:10:14:10 | x | provenance | Sink:MaD:1 |
| test.cpp:10:10:10:18 | call to ymlSource | test.cpp:17:24:17:24 | x | provenance | |
| test.cpp:10:10:10:18 | call to ymlSource | test.cpp:21:27:21:27 | x | provenance | |
@@ -61,15 +127,15 @@ edges
| test.cpp:17:10:17:22 | call to ymlStepManual | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | |
| test.cpp:17:10:17:22 | call to ymlStepManual | test.cpp:18:10:18:10 | y | provenance | Sink:MaD:1 |
| test.cpp:17:24:17:24 | x | test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | provenance | |
| test.cpp:17:24:17:24 | x | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | MaD:35 |
| test.cpp:17:24:17:24 | x | test.cpp:17:10:17:22 | call to ymlStepManual | provenance | MaD:48 |
| test.cpp:21:10:21:25 | call to ymlStepGenerated | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | |
| test.cpp:21:10:21:25 | call to ymlStepGenerated | test.cpp:22:10:22:10 | z | provenance | Sink:MaD:1 |
| test.cpp:21:27:21:27 | x | test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | provenance | |
| test.cpp:21:27:21:27 | x | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | MaD:34 |
| test.cpp:21:27:21:27 | x | test.cpp:21:10:21:25 | call to ymlStepGenerated | provenance | MaD:47 |
| test.cpp:25:11:25:33 | call to ymlStepManual_with_body | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | |
| test.cpp:25:11:25:33 | call to ymlStepManual_with_body | test.cpp:26:10:26:11 | y2 | provenance | Sink:MaD:1 |
| test.cpp:25:35:25:35 | x | test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | provenance | |
| test.cpp:25:35:25:35 | x | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | MaD:36 |
| test.cpp:25:35:25:35 | x | test.cpp:25:11:25:33 | call to ymlStepManual_with_body | provenance | MaD:49 |
| test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | provenance | |
| test.cpp:32:11:32:36 | call to ymlStepGenerated_with_body | test.cpp:33:10:33:11 | z2 | provenance | Sink:MaD:1 |
| test.cpp:32:41:32:41 | x | test.cpp:7:47:7:52 | value2 | provenance | |
@@ -77,16 +143,16 @@ edges
| test.cpp:46:30:46:32 | *arg [x] | test.cpp:47:12:47:19 | *arg [x] | provenance | |
| test.cpp:47:12:47:19 | *arg [x] | test.cpp:48:13:48:13 | *s [x] | provenance | |
| test.cpp:48:13:48:13 | *s [x] | test.cpp:48:16:48:16 | x | provenance | Sink:MaD:1 |
| test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | provenance | MaD:33 |
| test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | provenance | MaD:46 |
| test.cpp:52:5:52:18 | [summary] to write: Argument[2].Parameter[*0] in pthread_create [x] | test.cpp:46:30:46:32 | *arg [x] | provenance | |
| test.cpp:56:2:56:2 | *s [post update] [x] | test.cpp:59:55:59:64 | *& ... [x] | provenance | |
| test.cpp:56:2:56:18 | ... = ... | test.cpp:56:2:56:2 | *s [post update] [x] | provenance | |
| test.cpp:56:8:56:16 | call to ymlSource | test.cpp:56:2:56:18 | ... = ... | provenance | Src:MaD:16 |
| test.cpp:56:8:56:16 | call to ymlSource | test.cpp:56:2:56:18 | ... = ... | provenance | Src:MaD:22 |
| test.cpp:59:55:59:64 | *& ... [x] | test.cpp:52:5:52:18 | [summary param] *3 in pthread_create [x] | provenance | |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:31 |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:31 |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:31 |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:31 |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:44 |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:44 |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:44 |
| test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | provenance | MaD:44 |
| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:68:22:68:22 | y | provenance | |
| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:74:22:74:22 | y | provenance | |
| test.cpp:63:6:63:21 | [summary] to write: Argument[0].Parameter[0] in callWithArgument | test.cpp:82:22:82:22 | y | provenance | |
@@ -95,7 +161,7 @@ edges
| test.cpp:74:22:74:22 | y | test.cpp:75:11:75:11 | y | provenance | Sink:MaD:1 |
| test.cpp:82:22:82:22 | y | test.cpp:83:11:83:11 | y | provenance | Sink:MaD:1 |
| test.cpp:88:22:88:22 | y | test.cpp:89:11:89:11 | y | provenance | Sink:MaD:1 |
| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:94:10:94:18 | call to ymlSource | provenance | Src:MaD:16 |
| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:94:10:94:18 | call to ymlSource | provenance | Src:MaD:22 |
| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:97:26:97:26 | x | provenance | |
| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:101:26:101:26 | x | provenance | |
| test.cpp:94:10:94:18 | call to ymlSource | test.cpp:103:63:103:63 | x | provenance | |
@@ -104,28 +170,28 @@ edges
| test.cpp:101:26:101:26 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | |
| test.cpp:103:63:103:63 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | |
| test.cpp:104:62:104:62 | x | test.cpp:63:6:63:21 | [summary param] 1 in callWithArgument | provenance | |
| test.cpp:111:3:111:25 | [summary param] *0 in callWithNonTypeTemplate | test.cpp:111:3:111:25 | [summary] to write: ReturnValue in callWithNonTypeTemplate | provenance | MaD:32 |
| test.cpp:114:10:114:18 | call to ymlSource | test.cpp:114:10:114:18 | call to ymlSource | provenance | Src:MaD:16 |
| test.cpp:111:3:111:25 | [summary param] *0 in callWithNonTypeTemplate | test.cpp:111:3:111:25 | [summary] to write: ReturnValue in callWithNonTypeTemplate | provenance | MaD:45 |
| test.cpp:114:10:114:18 | call to ymlSource | test.cpp:114:10:114:18 | call to ymlSource | provenance | Src:MaD:22 |
| test.cpp:114:10:114:18 | call to ymlSource | test.cpp:118:44:118:44 | *x | provenance | |
| test.cpp:118:11:118:42 | call to callWithNonTypeTemplate | test.cpp:118:11:118:42 | call to callWithNonTypeTemplate | provenance | |
| test.cpp:118:11:118:42 | call to callWithNonTypeTemplate | test.cpp:119:10:119:11 | y2 | provenance | Sink:MaD:1 |
| test.cpp:118:44:118:44 | *x | test.cpp:111:3:111:25 | [summary param] *0 in callWithNonTypeTemplate | provenance | |
| test.cpp:118:44:118:44 | *x | test.cpp:118:11:118:42 | call to callWithNonTypeTemplate | provenance | MaD:32 |
| windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | provenance | MaD:18 |
| test.cpp:118:44:118:44 | *x | test.cpp:118:11:118:42 | call to callWithNonTypeTemplate | provenance | MaD:45 |
| windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | windows.cpp:17:8:17:25 | [summary] to write: ReturnValue[**] in CommandLineToArgvA | provenance | MaD:30 |
| windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:22:15:22:29 | *call to GetCommandLineA | provenance | Src:MaD:3 |
| windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:24:8:24:11 | * ... | provenance | |
| windows.cpp:22:15:22:29 | *call to GetCommandLineA | windows.cpp:27:36:27:38 | *cmd | provenance | |
| windows.cpp:27:17:27:34 | **call to CommandLineToArgvA | windows.cpp:27:17:27:34 | **call to CommandLineToArgvA | provenance | |
| windows.cpp:27:17:27:34 | **call to CommandLineToArgvA | windows.cpp:30:8:30:15 | * ... | provenance | |
| windows.cpp:27:36:27:38 | *cmd | windows.cpp:17:8:17:25 | [summary param] *0 in CommandLineToArgvA | provenance | |
| windows.cpp:27:36:27:38 | *cmd | windows.cpp:27:17:27:34 | **call to CommandLineToArgvA | provenance | MaD:18 |
| windows.cpp:27:36:27:38 | *cmd | windows.cpp:27:17:27:34 | **call to CommandLineToArgvA | provenance | MaD:30 |
| windows.cpp:34:17:34:38 | *call to GetEnvironmentStringsA | windows.cpp:34:17:34:38 | *call to GetEnvironmentStringsA | provenance | Src:MaD:4 |
| windows.cpp:34:17:34:38 | *call to GetEnvironmentStringsA | windows.cpp:36:10:36:13 | * ... | provenance | |
| windows.cpp:39:36:39:38 | GetEnvironmentVariableA output argument | windows.cpp:41:10:41:13 | * ... | provenance | Src:MaD:5 |
| windows.cpp:90:6:90:15 | [summary param] *3 in ReadFileEx [*hEvent] | windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[*hEvent] in ReadFileEx | provenance | |
| windows.cpp:90:6:90:15 | [summary param] *3 in ReadFileEx [hEvent] | windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[hEvent] in ReadFileEx | provenance | |
| windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[*hEvent] in ReadFileEx | windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2].Field[*hEvent] in ReadFileEx | provenance | MaD:22 |
| windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[hEvent] in ReadFileEx | windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2].Field[hEvent] in ReadFileEx | provenance | MaD:22 |
| windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[*hEvent] in ReadFileEx | windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2].Field[*hEvent] in ReadFileEx | provenance | MaD:34 |
| windows.cpp:90:6:90:15 | [summary] read: Argument[*3].Field[hEvent] in ReadFileEx | windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2].Field[hEvent] in ReadFileEx | provenance | MaD:34 |
| windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2] in ReadFileEx [*hEvent] | windows.cpp:147:16:147:27 | *lpOverlapped [*hEvent] | provenance | |
| windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2] in ReadFileEx [hEvent] | windows.cpp:157:16:157:27 | *lpOverlapped [hEvent] | provenance | |
| windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2].Field[*hEvent] in ReadFileEx | windows.cpp:90:6:90:15 | [summary] to write: Argument[4].Parameter[*2] in ReadFileEx [*hEvent] | provenance | |
@@ -173,11 +239,11 @@ edges
| windows.cpp:332:23:332:40 | *call to MapViewOfFileNuma2 | windows.cpp:332:23:332:40 | *call to MapViewOfFileNuma2 | provenance | Src:MaD:12 |
| windows.cpp:332:23:332:40 | *call to MapViewOfFileNuma2 | windows.cpp:333:20:333:52 | *pMapView | provenance | |
| windows.cpp:333:20:333:52 | *pMapView | windows.cpp:335:10:335:16 | * ... | provenance | |
| windows.cpp:349:8:349:19 | [summary param] *3 in CreateThread [x] | windows.cpp:349:8:349:19 | [summary] to write: Argument[2].Parameter[*0] in CreateThread [x] | provenance | MaD:21 |
| windows.cpp:349:8:349:19 | [summary param] *3 in CreateThread [x] | windows.cpp:349:8:349:19 | [summary] to write: Argument[2].Parameter[*0] in CreateThread [x] | provenance | MaD:33 |
| windows.cpp:349:8:349:19 | [summary] to write: Argument[2].Parameter[*0] in CreateThread [x] | windows.cpp:403:26:403:36 | *lpParameter [x] | provenance | |
| windows.cpp:357:8:357:25 | [summary param] *4 in CreateRemoteThread [x] | windows.cpp:357:8:357:25 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThread [x] | provenance | MaD:19 |
| windows.cpp:357:8:357:25 | [summary param] *4 in CreateRemoteThread [x] | windows.cpp:357:8:357:25 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThread [x] | provenance | MaD:31 |
| windows.cpp:357:8:357:25 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThread [x] | windows.cpp:410:26:410:36 | *lpParameter [x] | provenance | |
| windows.cpp:387:8:387:27 | [summary param] *4 in CreateRemoteThreadEx [x] | windows.cpp:387:8:387:27 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThreadEx [x] | provenance | MaD:20 |
| windows.cpp:387:8:387:27 | [summary param] *4 in CreateRemoteThreadEx [x] | windows.cpp:387:8:387:27 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThreadEx [x] | provenance | MaD:32 |
| windows.cpp:387:8:387:27 | [summary] to write: Argument[3].Parameter[*0] in CreateRemoteThreadEx [x] | windows.cpp:417:26:417:36 | *lpParameter [x] | provenance | |
| windows.cpp:403:26:403:36 | *lpParameter [x] | windows.cpp:405:10:405:25 | *lpParameter [x] | provenance | |
| windows.cpp:405:10:405:25 | *lpParameter [x] | windows.cpp:406:8:406:8 | *s [x] | provenance | |
@@ -196,17 +262,17 @@ edges
| windows.cpp:439:7:439:8 | *& ... [x] | windows.cpp:349:8:349:19 | [summary param] *3 in CreateThread [x] | provenance | |
| windows.cpp:451:7:451:8 | *& ... [x] | windows.cpp:357:8:357:25 | [summary param] *4 in CreateRemoteThread [x] | provenance | |
| windows.cpp:464:7:464:8 | *& ... [x] | windows.cpp:387:8:387:27 | [summary param] *4 in CreateRemoteThreadEx [x] | provenance | |
| windows.cpp:473:17:473:37 | [summary param] *1 in RtlCopyVolatileMemory | windows.cpp:473:17:473:37 | [summary param] *0 in RtlCopyVolatileMemory [Return] | provenance | MaD:27 |
| windows.cpp:479:17:479:35 | [summary param] *1 in RtlCopyDeviceMemory | windows.cpp:479:17:479:35 | [summary param] *0 in RtlCopyDeviceMemory [Return] | provenance | MaD:23 |
| windows.cpp:485:6:485:18 | [summary param] *1 in RtlCopyMemory | windows.cpp:485:6:485:18 | [summary param] *0 in RtlCopyMemory [Return] | provenance | MaD:24 |
| windows.cpp:493:6:493:29 | [summary param] *1 in RtlCopyMemoryNonTemporal | windows.cpp:493:6:493:29 | [summary param] *0 in RtlCopyMemoryNonTemporal [Return] | provenance | MaD:25 |
| windows.cpp:473:17:473:37 | [summary param] *1 in RtlCopyVolatileMemory | windows.cpp:473:17:473:37 | [summary param] *0 in RtlCopyVolatileMemory [Return] | provenance | MaD:39 |
| windows.cpp:479:17:479:35 | [summary param] *1 in RtlCopyDeviceMemory | windows.cpp:479:17:479:35 | [summary param] *0 in RtlCopyDeviceMemory [Return] | provenance | MaD:35 |
| windows.cpp:485:6:485:18 | [summary param] *1 in RtlCopyMemory | windows.cpp:485:6:485:18 | [summary param] *0 in RtlCopyMemory [Return] | provenance | MaD:36 |
| windows.cpp:493:6:493:29 | [summary param] *1 in RtlCopyMemoryNonTemporal | windows.cpp:493:6:493:29 | [summary param] *0 in RtlCopyMemoryNonTemporal [Return] | provenance | MaD:37 |
| windows.cpp:510:6:510:25 | [summary param] *1 in RtlCopyUnicodeString [*Buffer] | windows.cpp:510:6:510:25 | [summary] read: Argument[*1].Field[*Buffer] in RtlCopyUnicodeString | provenance | |
| windows.cpp:510:6:510:25 | [summary] read: Argument[*1].Field[*Buffer] in RtlCopyUnicodeString | windows.cpp:510:6:510:25 | [summary] to write: Argument[*0].Field[*Buffer] in RtlCopyUnicodeString | provenance | MaD:26 |
| windows.cpp:510:6:510:25 | [summary] read: Argument[*1].Field[*Buffer] in RtlCopyUnicodeString | windows.cpp:510:6:510:25 | [summary] to write: Argument[*0].Field[*Buffer] in RtlCopyUnicodeString | provenance | MaD:38 |
| windows.cpp:510:6:510:25 | [summary] to write: Argument[*0] in RtlCopyUnicodeString [*Buffer] | windows.cpp:510:6:510:25 | [summary param] *0 in RtlCopyUnicodeString [Return] [*Buffer] | provenance | |
| windows.cpp:510:6:510:25 | [summary] to write: Argument[*0].Field[*Buffer] in RtlCopyUnicodeString | windows.cpp:510:6:510:25 | [summary] to write: Argument[*0] in RtlCopyUnicodeString [*Buffer] | provenance | |
| windows.cpp:515:6:515:18 | [summary param] *1 in RtlMoveMemory | windows.cpp:515:6:515:18 | [summary param] *0 in RtlMoveMemory [Return] | provenance | MaD:29 |
| windows.cpp:521:17:521:37 | [summary param] *1 in RtlMoveVolatileMemory | windows.cpp:521:17:521:37 | [summary param] *0 in RtlMoveVolatileMemory [Return] | provenance | MaD:30 |
| windows.cpp:527:6:527:25 | [summary param] *1 in RtlInitUnicodeString | windows.cpp:527:6:527:25 | [summary] to write: Argument[*0].Field[*Buffer] in RtlInitUnicodeString | provenance | MaD:28 |
| windows.cpp:515:6:515:18 | [summary param] *1 in RtlMoveMemory | windows.cpp:515:6:515:18 | [summary param] *0 in RtlMoveMemory [Return] | provenance | MaD:41 |
| windows.cpp:521:17:521:37 | [summary param] *1 in RtlMoveVolatileMemory | windows.cpp:521:17:521:37 | [summary param] *0 in RtlMoveVolatileMemory [Return] | provenance | MaD:42 |
| windows.cpp:527:6:527:25 | [summary param] *1 in RtlInitUnicodeString | windows.cpp:527:6:527:25 | [summary] to write: Argument[*0].Field[*Buffer] in RtlInitUnicodeString | provenance | MaD:40 |
| windows.cpp:527:6:527:25 | [summary] to write: Argument[*0] in RtlInitUnicodeString [*Buffer] | windows.cpp:527:6:527:25 | [summary param] *0 in RtlInitUnicodeString [Return] [*Buffer] | provenance | |
| windows.cpp:527:6:527:25 | [summary] to write: Argument[*0].Field[*Buffer] in RtlInitUnicodeString | windows.cpp:527:6:527:25 | [summary] to write: Argument[*0] in RtlInitUnicodeString [*Buffer] | provenance | |
| windows.cpp:533:11:533:16 | call to source | windows.cpp:533:11:533:16 | call to source | provenance | |
@@ -218,37 +284,51 @@ edges
| windows.cpp:533:11:533:16 | call to source | windows.cpp:573:40:573:41 | *& ... | provenance | |
| windows.cpp:537:27:537:37 | RtlCopyVolatileMemory output argument | windows.cpp:538:10:538:23 | access to array | provenance | |
| windows.cpp:537:40:537:41 | *& ... | windows.cpp:473:17:473:37 | [summary param] *1 in RtlCopyVolatileMemory | provenance | |
| windows.cpp:537:40:537:41 | *& ... | windows.cpp:537:27:537:37 | RtlCopyVolatileMemory output argument | provenance | MaD:27 |
| windows.cpp:537:40:537:41 | *& ... | windows.cpp:537:27:537:37 | RtlCopyVolatileMemory output argument | provenance | MaD:39 |
| windows.cpp:542:25:542:35 | RtlCopyDeviceMemory output argument | windows.cpp:543:10:543:23 | access to array | provenance | |
| windows.cpp:542:38:542:39 | *& ... | windows.cpp:479:17:479:35 | [summary param] *1 in RtlCopyDeviceMemory | provenance | |
| windows.cpp:542:38:542:39 | *& ... | windows.cpp:542:25:542:35 | RtlCopyDeviceMemory output argument | provenance | MaD:23 |
| windows.cpp:542:38:542:39 | *& ... | windows.cpp:542:25:542:35 | RtlCopyDeviceMemory output argument | provenance | MaD:35 |
| windows.cpp:547:19:547:29 | RtlCopyMemory output argument | windows.cpp:548:10:548:23 | access to array | provenance | |
| windows.cpp:547:32:547:33 | *& ... | windows.cpp:485:6:485:18 | [summary param] *1 in RtlCopyMemory | provenance | |
| windows.cpp:547:32:547:33 | *& ... | windows.cpp:547:19:547:29 | RtlCopyMemory output argument | provenance | MaD:24 |
| windows.cpp:547:32:547:33 | *& ... | windows.cpp:547:19:547:29 | RtlCopyMemory output argument | provenance | MaD:36 |
| windows.cpp:552:30:552:40 | RtlCopyMemoryNonTemporal output argument | windows.cpp:553:10:553:23 | access to array | provenance | |
| windows.cpp:552:43:552:44 | *& ... | windows.cpp:493:6:493:29 | [summary param] *1 in RtlCopyMemoryNonTemporal | provenance | |
| windows.cpp:552:43:552:44 | *& ... | windows.cpp:552:30:552:40 | RtlCopyMemoryNonTemporal output argument | provenance | MaD:25 |
| windows.cpp:552:43:552:44 | *& ... | windows.cpp:552:30:552:40 | RtlCopyMemoryNonTemporal output argument | provenance | MaD:37 |
| windows.cpp:559:5:559:24 | ... = ... | windows.cpp:561:39:561:44 | *buffer | provenance | |
| windows.cpp:559:17:559:24 | call to source | windows.cpp:559:5:559:24 | ... = ... | provenance | |
| windows.cpp:561:26:561:36 | RtlInitUnicodeString output argument [*Buffer] | windows.cpp:562:10:562:19 | *src_string [*Buffer] | provenance | |
| windows.cpp:561:26:561:36 | RtlInitUnicodeString output argument [*Buffer] | windows.cpp:563:40:563:50 | *& ... [*Buffer] | provenance | |
| windows.cpp:561:39:561:44 | *buffer | windows.cpp:527:6:527:25 | [summary param] *1 in RtlInitUnicodeString | provenance | |
| windows.cpp:561:39:561:44 | *buffer | windows.cpp:561:26:561:36 | RtlInitUnicodeString output argument [*Buffer] | provenance | MaD:28 |
| windows.cpp:561:39:561:44 | *buffer | windows.cpp:561:26:561:36 | RtlInitUnicodeString output argument [*Buffer] | provenance | MaD:40 |
| windows.cpp:562:10:562:19 | *src_string [*Buffer] | windows.cpp:562:10:562:29 | access to array | provenance | |
| windows.cpp:562:10:562:19 | *src_string [*Buffer] | windows.cpp:562:21:562:26 | *Buffer | provenance | |
| windows.cpp:562:21:562:26 | *Buffer | windows.cpp:562:10:562:29 | access to array | provenance | |
| windows.cpp:563:26:563:37 | RtlCopyUnicodeString output argument [*Buffer] | windows.cpp:564:10:564:20 | *dest_string [*Buffer] | provenance | |
| windows.cpp:563:40:563:50 | *& ... [*Buffer] | windows.cpp:510:6:510:25 | [summary param] *1 in RtlCopyUnicodeString [*Buffer] | provenance | |
| windows.cpp:563:40:563:50 | *& ... [*Buffer] | windows.cpp:563:26:563:37 | RtlCopyUnicodeString output argument [*Buffer] | provenance | MaD:26 |
| windows.cpp:563:40:563:50 | *& ... [*Buffer] | windows.cpp:563:26:563:37 | RtlCopyUnicodeString output argument [*Buffer] | provenance | MaD:38 |
| windows.cpp:564:10:564:20 | *dest_string [*Buffer] | windows.cpp:564:10:564:30 | access to array | provenance | |
| windows.cpp:564:10:564:20 | *dest_string [*Buffer] | windows.cpp:564:22:564:27 | *Buffer | provenance | |
| windows.cpp:564:22:564:27 | *Buffer | windows.cpp:564:10:564:30 | access to array | provenance | |
| windows.cpp:568:19:568:29 | RtlMoveMemory output argument | windows.cpp:569:10:569:23 | access to array | provenance | |
| windows.cpp:568:32:568:33 | *& ... | windows.cpp:515:6:515:18 | [summary param] *1 in RtlMoveMemory | provenance | |
| windows.cpp:568:32:568:33 | *& ... | windows.cpp:568:19:568:29 | RtlMoveMemory output argument | provenance | MaD:29 |
| windows.cpp:568:32:568:33 | *& ... | windows.cpp:568:19:568:29 | RtlMoveMemory output argument | provenance | MaD:41 |
| windows.cpp:573:27:573:37 | RtlMoveVolatileMemory output argument | windows.cpp:574:10:574:23 | access to array | provenance | |
| windows.cpp:573:40:573:41 | *& ... | windows.cpp:521:17:521:37 | [summary param] *1 in RtlMoveVolatileMemory | provenance | |
| windows.cpp:573:40:573:41 | *& ... | windows.cpp:573:27:573:37 | RtlMoveVolatileMemory output argument | provenance | MaD:30 |
| windows.cpp:573:40:573:41 | *& ... | windows.cpp:573:27:573:37 | RtlMoveVolatileMemory output argument | provenance | MaD:42 |
| windows.cpp:645:45:645:50 | WinHttpReadData output argument | windows.cpp:647:10:647:16 | * ... | provenance | Src:MaD:20 |
| windows.cpp:652:48:652:53 | WinHttpReadDataEx output argument | windows.cpp:654:10:654:16 | * ... | provenance | Src:MaD:21 |
| windows.cpp:659:47:659:52 | WinHttpQueryHeaders output argument | windows.cpp:661:10:661:16 | * ... | provenance | Src:MaD:16 |
| windows.cpp:669:70:669:79 | WinHttpQueryHeadersEx output argument | windows.cpp:673:10:673:29 | * ... | provenance | Src:MaD:18 |
| windows.cpp:669:82:669:87 | WinHttpQueryHeadersEx output argument | windows.cpp:671:10:671:16 | * ... | provenance | Src:MaD:19 |
| windows.cpp:669:105:669:112 | WinHttpQueryHeadersEx output argument | windows.cpp:675:10:675:27 | * ... | provenance | Src:MaD:17 |
| windows.cpp:714:6:714:20 | [summary param] *0 in WinHttpCrackUrl | windows.cpp:714:6:714:20 | [summary param] *3 in WinHttpCrackUrl [Return] | provenance | MaD:43 |
| windows.cpp:728:5:728:28 | ... = ... | windows.cpp:729:35:729:35 | *x | provenance | |
| windows.cpp:728:12:728:28 | call to source | windows.cpp:728:5:728:28 | ... = ... | provenance | |
| windows.cpp:729:35:729:35 | *x | windows.cpp:714:6:714:20 | [summary param] *0 in WinHttpCrackUrl | provenance | |
| windows.cpp:729:35:729:35 | *x | windows.cpp:729:44:729:57 | WinHttpCrackUrl output argument | provenance | MaD:43 |
| windows.cpp:729:44:729:57 | WinHttpCrackUrl output argument | windows.cpp:731:10:731:36 | * ... | provenance | |
| windows.cpp:729:44:729:57 | WinHttpCrackUrl output argument | windows.cpp:733:10:733:35 | * ... | provenance | |
| windows.cpp:729:44:729:57 | WinHttpCrackUrl output argument | windows.cpp:735:10:735:37 | * ... | provenance | |
nodes
| asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | semmle.label | [summary param] *0 in buffer |
| asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | semmle.label | [summary] to write: ReturnValue in buffer |
@@ -262,6 +342,59 @@ nodes
| asio_streams.cpp:100:64:100:71 | *send_str | semmle.label | *send_str |
| asio_streams.cpp:101:7:101:17 | send_buffer | semmle.label | send_buffer |
| asio_streams.cpp:103:29:103:39 | *send_buffer | semmle.label | *send_buffer |
| azure.cpp:62:10:62:14 | [summary param] this in Value | semmle.label | [summary param] this in Value |
| azure.cpp:62:10:62:14 | [summary] to write: ReturnValue[*] in Value | semmle.label | [summary] to write: ReturnValue[*] in Value |
| azure.cpp:113:16:113:19 | [summary param] *0 in Read [Return] | semmle.label | [summary param] *0 in Read [Return] |
| azure.cpp:113:16:113:19 | [summary param] this in Read | semmle.label | [summary param] this in Read |
| azure.cpp:114:16:114:26 | [summary param] *0 in ReadToCount [Return] | semmle.label | [summary param] *0 in ReadToCount [Return] |
| azure.cpp:114:16:114:26 | [summary param] this in ReadToCount | semmle.label | [summary param] this in ReadToCount |
| azure.cpp:115:30:115:38 | [summary param] this in ReadToEnd | semmle.label | [summary param] this in ReadToEnd |
| azure.cpp:115:30:115:38 | [summary] to write: ReturnValue in ReadToEnd [element] | semmle.label | [summary] to write: ReturnValue in ReadToEnd [element] |
| azure.cpp:115:30:115:38 | [summary] to write: ReturnValue.Element in ReadToEnd | semmle.label | [summary] to write: ReturnValue.Element in ReadToEnd |
| azure.cpp:253:48:253:60 | *call to GetBodyStream | semmle.label | *call to GetBodyStream |
| azure.cpp:253:48:253:60 | *call to GetBodyStream | semmle.label | *call to GetBodyStream |
| azure.cpp:257:5:257:8 | *resp | semmle.label | *resp |
| azure.cpp:257:16:257:21 | Read output argument | semmle.label | Read output argument |
| azure.cpp:258:10:258:16 | * ... | semmle.label | * ... |
| azure.cpp:262:5:262:8 | *resp | semmle.label | *resp |
| azure.cpp:262:23:262:28 | ReadToCount output argument | semmle.label | ReadToCount output argument |
| azure.cpp:263:10:263:16 | * ... | semmle.label | * ... |
| azure.cpp:266:38:266:41 | *resp | semmle.label | *resp |
| azure.cpp:266:44:266:52 | call to ReadToEnd [element] | semmle.label | call to ReadToEnd [element] |
| azure.cpp:266:44:266:52 | call to ReadToEnd [element] | semmle.label | call to ReadToEnd [element] |
| azure.cpp:267:10:267:12 | vec | semmle.label | vec |
| azure.cpp:267:10:267:12 | vec [element] | semmle.label | vec [element] |
| azure.cpp:273:62:273:64 | call to GetHeaders | semmle.label | call to GetHeaders |
| azure.cpp:273:62:273:64 | call to GetHeaders | semmle.label | call to GetHeaders |
| azure.cpp:274:10:274:29 | call to operator[] | semmle.label | call to operator[] |
| azure.cpp:274:14:274:29 | call to operator[] | semmle.label | call to operator[] |
| azure.cpp:274:14:274:29 | call to operator[] | semmle.label | call to operator[] |
| azure.cpp:274:14:274:29 | call to operator[] | semmle.label | call to operator[] |
| azure.cpp:277:45:277:47 | call to GetBody | semmle.label | call to GetBody |
| azure.cpp:277:45:277:47 | call to GetBody | semmle.label | call to GetBody |
| azure.cpp:278:10:278:13 | body | semmle.label | body |
| azure.cpp:278:10:278:13 | body | semmle.label | body |
| azure.cpp:278:10:278:13 | body | semmle.label | body |
| azure.cpp:281:68:281:84 | *call to ExtractBodyStream | semmle.label | *call to ExtractBodyStream |
| azure.cpp:281:68:281:84 | *call to ExtractBodyStream | semmle.label | *call to ExtractBodyStream |
| azure.cpp:282:10:282:38 | call to ReadToEnd | semmle.label | call to ReadToEnd |
| azure.cpp:282:21:282:23 | *call to get | semmle.label | *call to get |
| azure.cpp:282:28:282:36 | call to ReadToEnd [element] | semmle.label | call to ReadToEnd [element] |
| azure.cpp:282:28:282:36 | call to ReadToEnd [element] | semmle.label | call to ReadToEnd [element] |
| azure.cpp:289:24:289:56 | call to GetHeader | semmle.label | call to GetHeader |
| azure.cpp:289:32:289:40 | call to GetHeader | semmle.label | call to GetHeader |
| azure.cpp:289:32:289:40 | call to GetHeader | semmle.label | call to GetHeader |
| azure.cpp:289:63:289:65 | call to Value | semmle.label | call to Value |
| azure.cpp:289:63:289:65 | call to Value | semmle.label | call to Value |
| azure.cpp:290:10:290:20 | headerValue | semmle.label | headerValue |
| azure.cpp:290:10:290:20 | headerValue | semmle.label | headerValue |
| azure.cpp:290:10:290:20 | headerValue | semmle.label | headerValue |
| azure.cpp:293:58:293:67 | call to GetHeaders | semmle.label | call to GetHeaders |
| azure.cpp:293:58:293:67 | call to GetHeaders | semmle.label | call to GetHeaders |
| azure.cpp:294:38:294:53 | call to operator[] | semmle.label | call to operator[] |
| azure.cpp:295:10:295:20 | contentType | semmle.label | contentType |
| azure.cpp:295:10:295:20 | contentType | semmle.label | contentType |
| azure.cpp:295:10:295:20 | contentType | semmle.label | contentType |
| test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | semmle.label | [summary param] 0 in ymlStepManual |
| test.cpp:4:5:4:17 | [summary] to write: ReturnValue in ymlStepManual | semmle.label | [summary] to write: ReturnValue in ymlStepManual |
| test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | semmle.label | [summary param] 0 in ymlStepGenerated |
@@ -482,8 +615,34 @@ nodes
| windows.cpp:573:27:573:37 | RtlMoveVolatileMemory output argument | semmle.label | RtlMoveVolatileMemory output argument |
| windows.cpp:573:40:573:41 | *& ... | semmle.label | *& ... |
| windows.cpp:574:10:574:23 | access to array | semmle.label | access to array |
| windows.cpp:645:45:645:50 | WinHttpReadData output argument | semmle.label | WinHttpReadData output argument |
| windows.cpp:647:10:647:16 | * ... | semmle.label | * ... |
| windows.cpp:652:48:652:53 | WinHttpReadDataEx output argument | semmle.label | WinHttpReadDataEx output argument |
| windows.cpp:654:10:654:16 | * ... | semmle.label | * ... |
| windows.cpp:659:47:659:52 | WinHttpQueryHeaders output argument | semmle.label | WinHttpQueryHeaders output argument |
| windows.cpp:661:10:661:16 | * ... | semmle.label | * ... |
| windows.cpp:669:70:669:79 | WinHttpQueryHeadersEx output argument | semmle.label | WinHttpQueryHeadersEx output argument |
| windows.cpp:669:82:669:87 | WinHttpQueryHeadersEx output argument | semmle.label | WinHttpQueryHeadersEx output argument |
| windows.cpp:669:105:669:112 | WinHttpQueryHeadersEx output argument | semmle.label | WinHttpQueryHeadersEx output argument |
| windows.cpp:671:10:671:16 | * ... | semmle.label | * ... |
| windows.cpp:673:10:673:29 | * ... | semmle.label | * ... |
| windows.cpp:675:10:675:27 | * ... | semmle.label | * ... |
| windows.cpp:714:6:714:20 | [summary param] *0 in WinHttpCrackUrl | semmle.label | [summary param] *0 in WinHttpCrackUrl |
| windows.cpp:714:6:714:20 | [summary param] *3 in WinHttpCrackUrl [Return] | semmle.label | [summary param] *3 in WinHttpCrackUrl [Return] |
| windows.cpp:728:5:728:28 | ... = ... | semmle.label | ... = ... |
| windows.cpp:728:12:728:28 | call to source | semmle.label | call to source |
| windows.cpp:729:35:729:35 | *x | semmle.label | *x |
| windows.cpp:729:44:729:57 | WinHttpCrackUrl output argument | semmle.label | WinHttpCrackUrl output argument |
| windows.cpp:731:10:731:36 | * ... | semmle.label | * ... |
| windows.cpp:733:10:733:35 | * ... | semmle.label | * ... |
| windows.cpp:735:10:735:37 | * ... | semmle.label | * ... |
subpaths
| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:56:18:56:23 | [summary param] *0 in buffer | asio_streams.cpp:56:18:56:23 | [summary] to write: ReturnValue in buffer | asio_streams.cpp:100:44:100:62 | call to buffer |
| azure.cpp:257:5:257:8 | *resp | azure.cpp:113:16:113:19 | [summary param] this in Read | azure.cpp:113:16:113:19 | [summary param] *0 in Read [Return] | azure.cpp:257:16:257:21 | Read output argument |
| azure.cpp:262:5:262:8 | *resp | azure.cpp:114:16:114:26 | [summary param] this in ReadToCount | azure.cpp:114:16:114:26 | [summary param] *0 in ReadToCount [Return] | azure.cpp:262:23:262:28 | ReadToCount output argument |
| azure.cpp:266:38:266:41 | *resp | azure.cpp:115:30:115:38 | [summary param] this in ReadToEnd | azure.cpp:115:30:115:38 | [summary] to write: ReturnValue in ReadToEnd [element] | azure.cpp:266:44:266:52 | call to ReadToEnd [element] |
| azure.cpp:282:21:282:23 | *call to get | azure.cpp:115:30:115:38 | [summary param] this in ReadToEnd | azure.cpp:115:30:115:38 | [summary] to write: ReturnValue in ReadToEnd [element] | azure.cpp:282:28:282:36 | call to ReadToEnd [element] |
| azure.cpp:289:24:289:56 | call to GetHeader | azure.cpp:62:10:62:14 | [summary param] this in Value | azure.cpp:62:10:62:14 | [summary] to write: ReturnValue[*] in Value | azure.cpp:289:63:289:65 | call to Value |
| test.cpp:17:24:17:24 | x | test.cpp:4:5:4:17 | [summary param] 0 in ymlStepManual | test.cpp:4:5:4:17 | [summary] to write: ReturnValue in ymlStepManual | test.cpp:17:10:17:22 | call to ymlStepManual |
| test.cpp:21:27:21:27 | x | test.cpp:5:5:5:20 | [summary param] 0 in ymlStepGenerated | test.cpp:5:5:5:20 | [summary] to write: ReturnValue in ymlStepGenerated | test.cpp:21:10:21:25 | call to ymlStepGenerated |
| test.cpp:25:35:25:35 | x | test.cpp:6:5:6:27 | [summary param] 0 in ymlStepManual_with_body | test.cpp:6:5:6:27 | [summary] to write: ReturnValue in ymlStepManual_with_body | test.cpp:25:11:25:33 | call to ymlStepManual_with_body |
@@ -498,4 +657,5 @@ subpaths
| windows.cpp:563:40:563:50 | *& ... [*Buffer] | windows.cpp:510:6:510:25 | [summary param] *1 in RtlCopyUnicodeString [*Buffer] | windows.cpp:510:6:510:25 | [summary param] *0 in RtlCopyUnicodeString [Return] [*Buffer] | windows.cpp:563:26:563:37 | RtlCopyUnicodeString output argument [*Buffer] |
| windows.cpp:568:32:568:33 | *& ... | windows.cpp:515:6:515:18 | [summary param] *1 in RtlMoveMemory | windows.cpp:515:6:515:18 | [summary param] *0 in RtlMoveMemory [Return] | windows.cpp:568:19:568:29 | RtlMoveMemory output argument |
| windows.cpp:573:40:573:41 | *& ... | windows.cpp:521:17:521:37 | [summary param] *1 in RtlMoveVolatileMemory | windows.cpp:521:17:521:37 | [summary param] *0 in RtlMoveVolatileMemory [Return] | windows.cpp:573:27:573:37 | RtlMoveVolatileMemory output argument |
| windows.cpp:729:35:729:35 | *x | windows.cpp:714:6:714:20 | [summary param] *0 in WinHttpCrackUrl | windows.cpp:714:6:714:20 | [summary param] *3 in WinHttpCrackUrl [Return] | windows.cpp:729:44:729:57 | WinHttpCrackUrl output argument |
testFailures

View File

@@ -1,4 +1,10 @@
| asio_streams.cpp:87:34:87:44 | read_until output argument | remote |
| azure.cpp:253:48:253:60 | *call to GetBodyStream | remote |
| azure.cpp:273:62:273:64 | call to GetHeaders | remote |
| azure.cpp:277:45:277:47 | call to GetBody | remote |
| azure.cpp:281:68:281:84 | *call to ExtractBodyStream | remote |
| azure.cpp:289:32:289:40 | call to GetHeader | remote |
| azure.cpp:293:58:293:67 | call to GetHeaders | remote |
| test.cpp:10:10:10:18 | call to ymlSource | local |
| test.cpp:56:8:56:16 | call to ymlSource | local |
| test.cpp:94:10:94:18 | call to ymlSource | local |
@@ -20,3 +26,9 @@
| windows.cpp:318:23:318:37 | *call to MapViewOfFileEx | local |
| windows.cpp:325:23:325:42 | *call to MapViewOfFileFromApp | local |
| windows.cpp:332:23:332:40 | *call to MapViewOfFileNuma2 | local |
| windows.cpp:645:45:645:50 | WinHttpReadData output argument | remote |
| windows.cpp:652:48:652:53 | WinHttpReadDataEx output argument | remote |
| windows.cpp:659:47:659:52 | WinHttpQueryHeaders output argument | remote |
| windows.cpp:669:70:669:79 | WinHttpQueryHeadersEx output argument | remote |
| windows.cpp:669:82:669:87 | WinHttpQueryHeadersEx output argument | remote |
| windows.cpp:669:105:669:112 | WinHttpQueryHeadersEx output argument | remote |

View File

@@ -1,6 +1,12 @@
| asio_streams.cpp:100:64:100:71 | *send_str | asio_streams.cpp:100:44:100:62 | call to buffer |
| azure.cpp:252:79:252:98 | call to string | azure.cpp:252:62:252:99 | call to Url |
| azure.cpp:257:5:257:8 | *resp | azure.cpp:257:16:257:21 | Read output argument |
| azure.cpp:262:5:262:8 | *resp | azure.cpp:262:23:262:28 | ReadToCount output argument |
| azure.cpp:287:79:287:98 | call to string | azure.cpp:287:62:287:99 | call to Url |
| azure.cpp:289:24:289:56 | call to GetHeader | azure.cpp:289:63:289:65 | call to Value |
| test.cpp:17:24:17:24 | x | test.cpp:17:10:17:22 | call to ymlStepManual |
| test.cpp:21:27:21:27 | x | test.cpp:21:10:21:25 | call to ymlStepGenerated |
| test.cpp:25:35:25:35 | x | test.cpp:25:11:25:33 | call to ymlStepManual_with_body |
| test.cpp:28:35:28:35 | 0 | test.cpp:28:11:28:33 | call to ymlStepManual_with_body |
| windows.cpp:27:36:27:38 | *cmd | windows.cpp:27:17:27:34 | **call to CommandLineToArgvA |
| windows.cpp:729:35:729:35 | *x | windows.cpp:729:44:729:57 | WinHttpCrackUrl output argument |

View File

@@ -5586,3 +5586,6 @@
| Unrecognized output specification "Field[***hEvent]" in summary model. |
| Unrecognized output specification "Parameter[***0]" in summary model. |
| Unrecognized output specification "Parameter[****0]" in summary model. |
| Unrecognized output specification "ReturnValue[*****]" in summary model. |
| Unrecognized output specification "ReturnValue[****]" in summary model. |
| Unrecognized output specification "ReturnValue[***]" in summary model. |

View File

@@ -573,4 +573,165 @@ void test_copy_and_move_memory() {
RtlMoveVolatileMemory(dest_buffer, &x, sizeof(x));
sink(dest_buffer[0]); // $ ir
}
}
using HINTERNET = void*;
using ULONGLONG = unsigned long long;
using UINT = unsigned int;
using PDWORD = DWORD*;
using PCSTR = const char*;
typedef union _WINHTTP_HEADER_NAME {
PCWSTR pwszName;
PCSTR pszName;
} WINHTTP_HEADER_NAME, *PWINHTTP_HEADER_NAME;
typedef struct _WINHTTP_EXTENDED_HEADER {
union {
PCWSTR pwszName;
PCSTR pszName;
};
union {
PCWSTR pwszValue;
PCSTR pszValue;
};
} WINHTTP_EXTENDED_HEADER, *PWINHTTP_EXTENDED_HEADER;
BOOL WinHttpReadData(
HINTERNET hRequest,
LPVOID lpBuffer,
DWORD dwNumberOfBytesToRead,
LPDWORD lpdwNumberOfBytesRead
);
DWORD WinHttpReadDataEx(
HINTERNET hRequest,
LPVOID lpBuffer,
DWORD dwNumberOfBytesToRead,
LPDWORD lpdwNumberOfBytesRead,
ULONGLONG ullFlags,
DWORD cbProperty,
PVOID pvProperty
);
using LPCWSTR = const wchar_t*;
BOOL WinHttpQueryHeaders(
HINTERNET hRequest,
DWORD dwInfoLevel,
LPCWSTR pwszName,
LPVOID lpBuffer,
LPDWORD lpdwBufferLength,
LPDWORD lpdwIndex
);
DWORD WinHttpQueryHeadersEx(
HINTERNET hRequest,
DWORD dwInfoLevel,
ULONGLONG ullFlags,
UINT uiCodePage,
PDWORD pdwIndex,
PWINHTTP_HEADER_NAME pHeaderName,
PVOID pBuffer,
PDWORD pdwBufferLength,
PWINHTTP_EXTENDED_HEADER *ppHeaders,
PDWORD pdwHeadersCount
);
void sink(PCSTR);
void test_winhttp(HINTERNET hRequest) {
{
char buffer[1024];
DWORD bytesRead;
BOOL result = WinHttpReadData(hRequest, buffer, sizeof(buffer), &bytesRead);
sink(buffer);
sink(*buffer); // $ ir
}
{
char buffer[1024];
DWORD bytesRead;
DWORD result = WinHttpReadDataEx(hRequest, buffer, sizeof(buffer), &bytesRead, 0, 0, nullptr);
sink(buffer);
sink(*buffer); // $ ir
}
{
char buffer[1024];
DWORD bufferLength = sizeof(buffer);
WinHttpQueryHeaders(hRequest, 0, nullptr, buffer, &bufferLength, nullptr);
sink(buffer);
sink(*buffer); // $ ir
}
{
char buffer[1024];
DWORD bufferLength = sizeof(buffer);
PWINHTTP_EXTENDED_HEADER headers;
DWORD headersCount;
PWINHTTP_HEADER_NAME headerName;
DWORD result = WinHttpQueryHeadersEx(hRequest, 0, 0, 0, nullptr, headerName, buffer, &bufferLength, &headers, &headersCount);
sink(buffer);
sink(*buffer); // $ ir
sink(headerName->pszName);
sink(*headerName->pszName); // $ ir
sink(headers->pszValue);
sink(*headers->pszValue); // $ ir
}
}
using LPWSTR = wchar_t*;
using INTERNET_SCHEME = enum {
INTERNET_SCHEME_INVALID = -1,
INTERNET_SCHEME_UNKNOWN = 0,
INTERNET_SCHEME_HTTP = 1,
INTERNET_SCHEME_HTTPS = 2,
INTERNET_SCHEME_FTP = 3,
INTERNET_SCHEME_FILE = 4,
INTERNET_SCHEME_NEWS = 5,
INTERNET_SCHEME_MAILTO = 6,
INTERNET_SCHEME_SNEWS = 7,
INTERNET_SCHEME_SOCKS = 8,
INTERNET_SCHEME_WAIS = 9,
INTERNET_SCHEME_LAST = 10
};
using INTERNET_PORT = unsigned short;
typedef struct _WINHTTP_URL_COMPONENTS {
DWORD dwStructSize;
LPWSTR lpszScheme;
DWORD dwSchemeLength;
INTERNET_SCHEME nScheme;
LPWSTR lpszHostName;
DWORD dwHostNameLength;
INTERNET_PORT nPort;
LPWSTR lpszUserName;
DWORD dwUserNameLength;
LPWSTR lpszPassword;
DWORD dwPasswordLength;
LPWSTR lpszUrlPath;
DWORD dwUrlPathLength;
LPWSTR lpszExtraInfo;
DWORD dwExtraInfoLength;
} URL_COMPONENTS, *LPURL_COMPONENTS;
BOOL WinHttpCrackUrl(
LPCWSTR pwszUrl,
DWORD dwUrlLength,
DWORD dwFlags,
LPURL_COMPONENTS lpUrlComponents
);
void sink(LPWSTR);
void test_winhttp_crack_url() {
{
URL_COMPONENTS urlComponents;
urlComponents.dwStructSize = sizeof(URL_COMPONENTS);
wchar_t x[256];
x[0] = (wchar_t)source();
BOOL result = WinHttpCrackUrl(x, 0, 0, &urlComponents);
sink(urlComponents.lpszHostName);
sink(*urlComponents.lpszHostName); // $ ir
sink(urlComponents.lpszUrlPath);
sink(*urlComponents.lpszUrlPath); // $ ir
sink(urlComponents.lpszExtraInfo);
sink(*urlComponents.lpszExtraInfo); // $ ir
}
}

View File

@@ -1025,6 +1025,7 @@
| test.c:970:12:970:12 | y | 256 |
| test.c:971:9:971:9 | x | 2147483647 |
| test.c:972:9:972:9 | y | 256 |
| test.c:985:7:985:7 | e | -2147483648 |
| test.cpp:10:7:10:7 | b | -2147483648 |
| test.cpp:11:5:11:5 | x | -2147483648 |
| test.cpp:13:10:13:10 | x | -2147483648 |
@@ -1093,3 +1094,64 @@
| test.cpp:122:4:122:4 | n | 0 |
| test.cpp:122:8:122:8 | n | 0 |
| test.cpp:122:12:122:12 | n | 1 |
| test_nr_of_bounds.cpp:40:5:40:20 | x | 0 |
| test_nr_of_bounds.cpp:40:5:40:20 | x | 0 |
| test_nr_of_bounds.cpp:41:5:41:20 | x | 0 |
| test_nr_of_bounds.cpp:41:5:41:20 | x | 0 |
| test_nr_of_bounds.cpp:42:5:42:20 | x | 0 |
| test_nr_of_bounds.cpp:42:5:42:20 | x | 0 |
| test_nr_of_bounds.cpp:43:5:43:20 | x | 0 |
| test_nr_of_bounds.cpp:43:5:43:20 | x | 0 |
| test_nr_of_bounds.cpp:44:5:44:20 | x | 0 |
| test_nr_of_bounds.cpp:44:5:44:20 | x | 0 |
| test_nr_of_bounds.cpp:45:5:45:20 | x | 0 |
| test_nr_of_bounds.cpp:45:5:45:20 | x | 0 |
| test_nr_of_bounds.cpp:46:5:46:20 | x | 0 |
| test_nr_of_bounds.cpp:46:5:46:20 | x | 0 |
| test_nr_of_bounds.cpp:47:5:47:20 | x | 0 |
| test_nr_of_bounds.cpp:47:5:47:20 | x | 0 |
| test_nr_of_bounds.cpp:48:5:48:20 | x | 0 |
| test_nr_of_bounds.cpp:48:5:48:20 | x | 0 |
| test_nr_of_bounds.cpp:49:5:49:20 | x | 0 |
| test_nr_of_bounds.cpp:49:5:49:20 | x | 0 |
| test_nr_of_bounds.cpp:50:5:50:20 | x | 0 |
| test_nr_of_bounds.cpp:50:5:50:20 | x | 0 |
| test_nr_of_bounds.cpp:51:5:51:20 | x | 0 |
| test_nr_of_bounds.cpp:51:5:51:20 | x | 0 |
| test_nr_of_bounds.cpp:52:5:52:20 | x | 0 |
| test_nr_of_bounds.cpp:52:5:52:20 | x | 0 |
| test_nr_of_bounds.cpp:53:5:53:20 | x | 0 |
| test_nr_of_bounds.cpp:53:5:53:20 | x | 0 |
| test_nr_of_bounds.cpp:54:5:54:20 | x | 0 |
| test_nr_of_bounds.cpp:54:5:54:20 | x | 0 |
| test_nr_of_bounds.cpp:55:5:55:20 | x | 0 |
| test_nr_of_bounds.cpp:55:5:55:20 | x | 0 |
| test_nr_of_bounds.cpp:56:5:56:20 | x | 0 |
| test_nr_of_bounds.cpp:56:5:56:20 | x | 0 |
| test_nr_of_bounds.cpp:57:5:57:20 | x | 0 |
| test_nr_of_bounds.cpp:57:5:57:20 | x | 0 |
| test_nr_of_bounds.cpp:58:5:58:20 | x | 0 |
| test_nr_of_bounds.cpp:58:5:58:20 | x | 0 |
| test_nr_of_bounds.cpp:59:5:59:20 | x | 0 |
| test_nr_of_bounds.cpp:59:5:59:20 | x | 0 |
| test_nr_of_bounds.cpp:60:5:60:20 | x | 0 |
| test_nr_of_bounds.cpp:60:5:60:20 | x | 0 |
| test_nr_of_bounds.cpp:61:5:61:20 | x | 0 |
| test_nr_of_bounds.cpp:61:5:61:20 | x | 0 |
| test_nr_of_bounds.cpp:62:5:62:20 | x | 0 |
| test_nr_of_bounds.cpp:62:5:62:20 | x | 0 |
| test_nr_of_bounds.cpp:63:5:63:20 | x | 0 |
| test_nr_of_bounds.cpp:63:5:63:20 | x | 0 |
| test_nr_of_bounds.cpp:64:5:64:20 | x | 0 |
| test_nr_of_bounds.cpp:64:5:64:20 | x | 0 |
| test_nr_of_bounds.cpp:65:5:65:21 | x | 0 |
| test_nr_of_bounds.cpp:65:5:65:21 | x | 0 |
| test_nr_of_bounds.cpp:66:5:66:21 | x | 0 |
| test_nr_of_bounds.cpp:66:5:66:21 | x | 0 |
| test_nr_of_bounds.cpp:67:5:67:21 | x | 0 |
| test_nr_of_bounds.cpp:67:5:67:21 | x | 0 |
| test_nr_of_bounds.cpp:68:5:68:21 | x | 0 |
| test_nr_of_bounds.cpp:68:5:68:21 | x | 0 |
| test_nr_of_bounds.cpp:69:5:69:21 | x | 0 |
| test_nr_of_bounds.cpp:69:5:69:21 | x | 0 |
| test_nr_of_bounds.cpp:72:12:72:12 | x | 0 |

View File

@@ -4546,6 +4546,13 @@ estimateNrOfBounds
| test.c:970:18:970:20 | 512 | 1.0 |
| test.c:971:9:971:9 | x | 1.0 |
| test.c:972:9:972:9 | y | 1.0 |
| test.c:977:9:977:11 | 1 | 1.0 |
| test.c:978:9:978:11 | 2 | 1.0 |
| test.c:979:9:979:11 | 4 | 1.0 |
| test.c:980:9:980:11 | 8 | 1.0 |
| test.c:981:9:981:12 | 16 | 1.0 |
| test.c:985:7:985:7 | (int)... | 1.0 |
| test.c:985:7:985:7 | e | 1.0 |
| test.cpp:9:11:9:12 | - ... | 1.0 |
| test.cpp:9:12:9:12 | 1 | 1.0 |
| test.cpp:10:7:10:7 | (bool)... | 1.0 |
@@ -4721,3 +4728,394 @@ estimateNrOfBounds
| test.cpp:122:4:122:4 | n | 8.0 |
| test.cpp:122:8:122:8 | n | 8.0 |
| test.cpp:122:12:122:12 | n | 8.0 |
| test_nr_of_bounds.cpp:2:9:2:11 | 1 | 1.0 |
| test_nr_of_bounds.cpp:3:9:3:11 | 2 | 1.0 |
| test_nr_of_bounds.cpp:4:9:4:11 | 4 | 1.0 |
| test_nr_of_bounds.cpp:5:9:5:11 | 8 | 1.0 |
| test_nr_of_bounds.cpp:6:9:6:12 | 16 | 1.0 |
| test_nr_of_bounds.cpp:7:9:7:12 | 32 | 1.0 |
| test_nr_of_bounds.cpp:8:9:8:12 | 64 | 1.0 |
| test_nr_of_bounds.cpp:9:9:9:12 | 128 | 1.0 |
| test_nr_of_bounds.cpp:10:9:10:13 | 256 | 1.0 |
| test_nr_of_bounds.cpp:11:9:11:13 | 512 | 1.0 |
| test_nr_of_bounds.cpp:12:9:12:13 | 1024 | 1.0 |
| test_nr_of_bounds.cpp:13:9:13:13 | 2048 | 1.0 |
| test_nr_of_bounds.cpp:14:9:14:14 | 4096 | 1.0 |
| test_nr_of_bounds.cpp:15:9:15:14 | 8192 | 1.0 |
| test_nr_of_bounds.cpp:16:9:16:14 | 16384 | 1.0 |
| test_nr_of_bounds.cpp:17:9:17:14 | 32768 | 1.0 |
| test_nr_of_bounds.cpp:18:9:18:15 | 65536 | 1.0 |
| test_nr_of_bounds.cpp:19:9:19:15 | 131072 | 1.0 |
| test_nr_of_bounds.cpp:20:9:20:15 | 262144 | 1.0 |
| test_nr_of_bounds.cpp:21:9:21:15 | 524288 | 1.0 |
| test_nr_of_bounds.cpp:22:9:22:16 | 1048576 | 1.0 |
| test_nr_of_bounds.cpp:23:9:23:16 | 2097152 | 1.0 |
| test_nr_of_bounds.cpp:24:9:24:16 | 4194304 | 1.0 |
| test_nr_of_bounds.cpp:25:9:25:16 | 8388608 | 1.0 |
| test_nr_of_bounds.cpp:26:9:26:17 | 16777216 | 1.0 |
| test_nr_of_bounds.cpp:27:10:27:18 | 33554432 | 1.0 |
| test_nr_of_bounds.cpp:28:10:28:18 | 67108864 | 1.0 |
| test_nr_of_bounds.cpp:29:10:29:18 | 134217728 | 1.0 |
| test_nr_of_bounds.cpp:30:10:30:19 | 268435456 | 1.0 |
| test_nr_of_bounds.cpp:31:10:31:19 | 536870912 | 1.0 |
| test_nr_of_bounds.cpp:40:5:40:19 | ... & ... | 1.0 |
| test_nr_of_bounds.cpp:40:5:40:19 | ... -= ... | 1.0 |
| test_nr_of_bounds.cpp:40:5:40:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:40:5:40:20 | (...) | 1.0 |
| test_nr_of_bounds.cpp:40:5:40:20 | x | 1.0 |
| test_nr_of_bounds.cpp:40:5:40:20 | x | 1.0 |
| test_nr_of_bounds.cpp:40:19:40:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:40:19:40:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:40:19:40:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:40:19:40:19 | A | 1.0 |
| test_nr_of_bounds.cpp:40:19:40:19 | A | 1.0 |
| test_nr_of_bounds.cpp:40:19:40:19 | A | 1.0 |
| test_nr_of_bounds.cpp:41:5:41:19 | ... & ... | 2.0 |
| test_nr_of_bounds.cpp:41:5:41:19 | ... -= ... | 2.0 |
| test_nr_of_bounds.cpp:41:5:41:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:41:5:41:20 | (...) | 2.0 |
| test_nr_of_bounds.cpp:41:5:41:20 | x | 2.0 |
| test_nr_of_bounds.cpp:41:5:41:20 | x | 2.0 |
| test_nr_of_bounds.cpp:41:19:41:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:41:19:41:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:41:19:41:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:41:19:41:19 | B | 1.0 |
| test_nr_of_bounds.cpp:41:19:41:19 | B | 1.0 |
| test_nr_of_bounds.cpp:41:19:41:19 | B | 1.0 |
| test_nr_of_bounds.cpp:42:5:42:19 | ... & ... | 4.0 |
| test_nr_of_bounds.cpp:42:5:42:19 | ... -= ... | 4.0 |
| test_nr_of_bounds.cpp:42:5:42:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:42:5:42:20 | (...) | 4.0 |
| test_nr_of_bounds.cpp:42:5:42:20 | x | 4.0 |
| test_nr_of_bounds.cpp:42:5:42:20 | x | 4.0 |
| test_nr_of_bounds.cpp:42:19:42:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:42:19:42:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:42:19:42:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:42:19:42:19 | C | 1.0 |
| test_nr_of_bounds.cpp:42:19:42:19 | C | 1.0 |
| test_nr_of_bounds.cpp:42:19:42:19 | C | 1.0 |
| test_nr_of_bounds.cpp:43:5:43:19 | ... & ... | 8.0 |
| test_nr_of_bounds.cpp:43:5:43:19 | ... -= ... | 8.0 |
| test_nr_of_bounds.cpp:43:5:43:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:43:5:43:20 | (...) | 8.0 |
| test_nr_of_bounds.cpp:43:5:43:20 | x | 8.0 |
| test_nr_of_bounds.cpp:43:5:43:20 | x | 8.0 |
| test_nr_of_bounds.cpp:43:19:43:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:43:19:43:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:43:19:43:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:43:19:43:19 | D | 1.0 |
| test_nr_of_bounds.cpp:43:19:43:19 | D | 1.0 |
| test_nr_of_bounds.cpp:43:19:43:19 | D | 1.0 |
| test_nr_of_bounds.cpp:44:5:44:19 | ... & ... | 16.0 |
| test_nr_of_bounds.cpp:44:5:44:19 | ... -= ... | 16.0 |
| test_nr_of_bounds.cpp:44:5:44:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:44:5:44:20 | (...) | 16.0 |
| test_nr_of_bounds.cpp:44:5:44:20 | x | 16.0 |
| test_nr_of_bounds.cpp:44:5:44:20 | x | 16.0 |
| test_nr_of_bounds.cpp:44:19:44:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:44:19:44:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:44:19:44:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:44:19:44:19 | E | 1.0 |
| test_nr_of_bounds.cpp:44:19:44:19 | E | 1.0 |
| test_nr_of_bounds.cpp:44:19:44:19 | E | 1.0 |
| test_nr_of_bounds.cpp:45:5:45:19 | ... & ... | 32.0 |
| test_nr_of_bounds.cpp:45:5:45:19 | ... -= ... | 32.0 |
| test_nr_of_bounds.cpp:45:5:45:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:45:5:45:20 | (...) | 32.0 |
| test_nr_of_bounds.cpp:45:5:45:20 | x | 32.0 |
| test_nr_of_bounds.cpp:45:5:45:20 | x | 32.0 |
| test_nr_of_bounds.cpp:45:19:45:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:45:19:45:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:45:19:45:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:45:19:45:19 | F | 1.0 |
| test_nr_of_bounds.cpp:45:19:45:19 | F | 1.0 |
| test_nr_of_bounds.cpp:45:19:45:19 | F | 1.0 |
| test_nr_of_bounds.cpp:46:5:46:19 | ... & ... | 64.0 |
| test_nr_of_bounds.cpp:46:5:46:19 | ... -= ... | 64.0 |
| test_nr_of_bounds.cpp:46:5:46:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:46:5:46:20 | (...) | 64.0 |
| test_nr_of_bounds.cpp:46:5:46:20 | x | 64.0 |
| test_nr_of_bounds.cpp:46:5:46:20 | x | 64.0 |
| test_nr_of_bounds.cpp:46:19:46:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:46:19:46:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:46:19:46:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:46:19:46:19 | G | 1.0 |
| test_nr_of_bounds.cpp:46:19:46:19 | G | 1.0 |
| test_nr_of_bounds.cpp:46:19:46:19 | G | 1.0 |
| test_nr_of_bounds.cpp:47:5:47:19 | ... & ... | 128.0 |
| test_nr_of_bounds.cpp:47:5:47:19 | ... -= ... | 128.0 |
| test_nr_of_bounds.cpp:47:5:47:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:47:5:47:20 | (...) | 128.0 |
| test_nr_of_bounds.cpp:47:5:47:20 | x | 128.0 |
| test_nr_of_bounds.cpp:47:5:47:20 | x | 128.0 |
| test_nr_of_bounds.cpp:47:19:47:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:47:19:47:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:47:19:47:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:47:19:47:19 | H | 1.0 |
| test_nr_of_bounds.cpp:47:19:47:19 | H | 1.0 |
| test_nr_of_bounds.cpp:47:19:47:19 | H | 1.0 |
| test_nr_of_bounds.cpp:48:5:48:19 | ... & ... | 256.0 |
| test_nr_of_bounds.cpp:48:5:48:19 | ... -= ... | 256.0 |
| test_nr_of_bounds.cpp:48:5:48:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:48:5:48:20 | (...) | 256.0 |
| test_nr_of_bounds.cpp:48:5:48:20 | x | 256.0 |
| test_nr_of_bounds.cpp:48:5:48:20 | x | 256.0 |
| test_nr_of_bounds.cpp:48:19:48:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:48:19:48:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:48:19:48:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:48:19:48:19 | I | 1.0 |
| test_nr_of_bounds.cpp:48:19:48:19 | I | 1.0 |
| test_nr_of_bounds.cpp:48:19:48:19 | I | 1.0 |
| test_nr_of_bounds.cpp:49:5:49:19 | ... & ... | 512.0 |
| test_nr_of_bounds.cpp:49:5:49:19 | ... -= ... | 512.0 |
| test_nr_of_bounds.cpp:49:5:49:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:49:5:49:20 | (...) | 512.0 |
| test_nr_of_bounds.cpp:49:5:49:20 | x | 512.0 |
| test_nr_of_bounds.cpp:49:5:49:20 | x | 512.0 |
| test_nr_of_bounds.cpp:49:19:49:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:49:19:49:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:49:19:49:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:49:19:49:19 | J | 1.0 |
| test_nr_of_bounds.cpp:49:19:49:19 | J | 1.0 |
| test_nr_of_bounds.cpp:49:19:49:19 | J | 1.0 |
| test_nr_of_bounds.cpp:50:5:50:19 | ... & ... | 1024.0 |
| test_nr_of_bounds.cpp:50:5:50:19 | ... -= ... | 1024.0 |
| test_nr_of_bounds.cpp:50:5:50:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:50:5:50:20 | (...) | 1024.0 |
| test_nr_of_bounds.cpp:50:5:50:20 | x | 1024.0 |
| test_nr_of_bounds.cpp:50:5:50:20 | x | 1024.0 |
| test_nr_of_bounds.cpp:50:19:50:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:50:19:50:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:50:19:50:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:50:19:50:19 | L | 1.0 |
| test_nr_of_bounds.cpp:50:19:50:19 | L | 1.0 |
| test_nr_of_bounds.cpp:50:19:50:19 | L | 1.0 |
| test_nr_of_bounds.cpp:51:5:51:19 | ... & ... | 2048.0 |
| test_nr_of_bounds.cpp:51:5:51:19 | ... -= ... | 2048.0 |
| test_nr_of_bounds.cpp:51:5:51:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:51:5:51:20 | (...) | 2048.0 |
| test_nr_of_bounds.cpp:51:5:51:20 | x | 2048.0 |
| test_nr_of_bounds.cpp:51:5:51:20 | x | 2048.0 |
| test_nr_of_bounds.cpp:51:19:51:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:51:19:51:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:51:19:51:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:51:19:51:19 | M | 1.0 |
| test_nr_of_bounds.cpp:51:19:51:19 | M | 1.0 |
| test_nr_of_bounds.cpp:51:19:51:19 | M | 1.0 |
| test_nr_of_bounds.cpp:52:5:52:19 | ... & ... | 4096.0 |
| test_nr_of_bounds.cpp:52:5:52:19 | ... -= ... | 4096.0 |
| test_nr_of_bounds.cpp:52:5:52:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:52:5:52:20 | (...) | 4096.0 |
| test_nr_of_bounds.cpp:52:5:52:20 | x | 4096.0 |
| test_nr_of_bounds.cpp:52:5:52:20 | x | 4096.0 |
| test_nr_of_bounds.cpp:52:19:52:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:52:19:52:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:52:19:52:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:52:19:52:19 | N | 1.0 |
| test_nr_of_bounds.cpp:52:19:52:19 | N | 1.0 |
| test_nr_of_bounds.cpp:52:19:52:19 | N | 1.0 |
| test_nr_of_bounds.cpp:53:5:53:19 | ... & ... | 8192.0 |
| test_nr_of_bounds.cpp:53:5:53:19 | ... -= ... | 8192.0 |
| test_nr_of_bounds.cpp:53:5:53:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:53:5:53:20 | (...) | 8192.0 |
| test_nr_of_bounds.cpp:53:5:53:20 | x | 8192.0 |
| test_nr_of_bounds.cpp:53:5:53:20 | x | 8192.0 |
| test_nr_of_bounds.cpp:53:19:53:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:53:19:53:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:53:19:53:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:53:19:53:19 | O | 1.0 |
| test_nr_of_bounds.cpp:53:19:53:19 | O | 1.0 |
| test_nr_of_bounds.cpp:53:19:53:19 | O | 1.0 |
| test_nr_of_bounds.cpp:54:5:54:19 | ... & ... | 16384.0 |
| test_nr_of_bounds.cpp:54:5:54:19 | ... -= ... | 16384.0 |
| test_nr_of_bounds.cpp:54:5:54:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:54:5:54:20 | (...) | 16384.0 |
| test_nr_of_bounds.cpp:54:5:54:20 | x | 16384.0 |
| test_nr_of_bounds.cpp:54:5:54:20 | x | 16384.0 |
| test_nr_of_bounds.cpp:54:19:54:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:54:19:54:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:54:19:54:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:54:19:54:19 | P | 1.0 |
| test_nr_of_bounds.cpp:54:19:54:19 | P | 1.0 |
| test_nr_of_bounds.cpp:54:19:54:19 | P | 1.0 |
| test_nr_of_bounds.cpp:55:5:55:19 | ... & ... | 32768.0 |
| test_nr_of_bounds.cpp:55:5:55:19 | ... -= ... | 32768.0 |
| test_nr_of_bounds.cpp:55:5:55:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:55:5:55:20 | (...) | 32768.0 |
| test_nr_of_bounds.cpp:55:5:55:20 | x | 32768.0 |
| test_nr_of_bounds.cpp:55:5:55:20 | x | 32768.0 |
| test_nr_of_bounds.cpp:55:19:55:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:55:19:55:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:55:19:55:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:55:19:55:19 | Q | 1.0 |
| test_nr_of_bounds.cpp:55:19:55:19 | Q | 1.0 |
| test_nr_of_bounds.cpp:55:19:55:19 | Q | 1.0 |
| test_nr_of_bounds.cpp:56:5:56:19 | ... & ... | 65536.0 |
| test_nr_of_bounds.cpp:56:5:56:19 | ... -= ... | 65536.0 |
| test_nr_of_bounds.cpp:56:5:56:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:56:5:56:20 | (...) | 65536.0 |
| test_nr_of_bounds.cpp:56:5:56:20 | x | 65536.0 |
| test_nr_of_bounds.cpp:56:5:56:20 | x | 65536.0 |
| test_nr_of_bounds.cpp:56:19:56:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:56:19:56:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:56:19:56:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:56:19:56:19 | R | 1.0 |
| test_nr_of_bounds.cpp:56:19:56:19 | R | 1.0 |
| test_nr_of_bounds.cpp:56:19:56:19 | R | 1.0 |
| test_nr_of_bounds.cpp:57:5:57:19 | ... & ... | 131072.0 |
| test_nr_of_bounds.cpp:57:5:57:19 | ... -= ... | 131072.0 |
| test_nr_of_bounds.cpp:57:5:57:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:57:5:57:20 | (...) | 131072.0 |
| test_nr_of_bounds.cpp:57:5:57:20 | x | 131072.0 |
| test_nr_of_bounds.cpp:57:5:57:20 | x | 131072.0 |
| test_nr_of_bounds.cpp:57:19:57:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:57:19:57:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:57:19:57:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:57:19:57:19 | S | 1.0 |
| test_nr_of_bounds.cpp:57:19:57:19 | S | 1.0 |
| test_nr_of_bounds.cpp:57:19:57:19 | S | 1.0 |
| test_nr_of_bounds.cpp:58:5:58:19 | ... & ... | 262144.0 |
| test_nr_of_bounds.cpp:58:5:58:19 | ... -= ... | 262144.0 |
| test_nr_of_bounds.cpp:58:5:58:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:58:5:58:20 | (...) | 262144.0 |
| test_nr_of_bounds.cpp:58:5:58:20 | x | 262144.0 |
| test_nr_of_bounds.cpp:58:5:58:20 | x | 262144.0 |
| test_nr_of_bounds.cpp:58:19:58:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:58:19:58:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:58:19:58:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:58:19:58:19 | T | 1.0 |
| test_nr_of_bounds.cpp:58:19:58:19 | T | 1.0 |
| test_nr_of_bounds.cpp:58:19:58:19 | T | 1.0 |
| test_nr_of_bounds.cpp:59:5:59:19 | ... & ... | 524288.0 |
| test_nr_of_bounds.cpp:59:5:59:19 | ... -= ... | 524288.0 |
| test_nr_of_bounds.cpp:59:5:59:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:59:5:59:20 | (...) | 524288.0 |
| test_nr_of_bounds.cpp:59:5:59:20 | x | 524288.0 |
| test_nr_of_bounds.cpp:59:5:59:20 | x | 524288.0 |
| test_nr_of_bounds.cpp:59:19:59:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:59:19:59:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:59:19:59:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:59:19:59:19 | U | 1.0 |
| test_nr_of_bounds.cpp:59:19:59:19 | U | 1.0 |
| test_nr_of_bounds.cpp:59:19:59:19 | U | 1.0 |
| test_nr_of_bounds.cpp:60:5:60:19 | ... & ... | 1048576.0 |
| test_nr_of_bounds.cpp:60:5:60:19 | ... -= ... | 1048576.0 |
| test_nr_of_bounds.cpp:60:5:60:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:60:5:60:20 | (...) | 1048576.0 |
| test_nr_of_bounds.cpp:60:5:60:20 | x | 1048576.0 |
| test_nr_of_bounds.cpp:60:5:60:20 | x | 1048576.0 |
| test_nr_of_bounds.cpp:60:19:60:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:60:19:60:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:60:19:60:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:60:19:60:19 | V | 1.0 |
| test_nr_of_bounds.cpp:60:19:60:19 | V | 1.0 |
| test_nr_of_bounds.cpp:60:19:60:19 | V | 1.0 |
| test_nr_of_bounds.cpp:61:5:61:19 | ... & ... | 2097152.0 |
| test_nr_of_bounds.cpp:61:5:61:19 | ... -= ... | 2097152.0 |
| test_nr_of_bounds.cpp:61:5:61:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:61:5:61:20 | (...) | 2097152.0 |
| test_nr_of_bounds.cpp:61:5:61:20 | x | 2097152.0 |
| test_nr_of_bounds.cpp:61:5:61:20 | x | 2097152.0 |
| test_nr_of_bounds.cpp:61:19:61:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:61:19:61:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:61:19:61:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:61:19:61:19 | W | 1.0 |
| test_nr_of_bounds.cpp:61:19:61:19 | W | 1.0 |
| test_nr_of_bounds.cpp:61:19:61:19 | W | 1.0 |
| test_nr_of_bounds.cpp:62:5:62:19 | ... & ... | 4194304.0 |
| test_nr_of_bounds.cpp:62:5:62:19 | ... -= ... | 4194304.0 |
| test_nr_of_bounds.cpp:62:5:62:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:62:5:62:20 | (...) | 4194304.0 |
| test_nr_of_bounds.cpp:62:5:62:20 | x | 4194304.0 |
| test_nr_of_bounds.cpp:62:5:62:20 | x | 4194304.0 |
| test_nr_of_bounds.cpp:62:19:62:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:62:19:62:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:62:19:62:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:62:19:62:19 | X | 1.0 |
| test_nr_of_bounds.cpp:62:19:62:19 | X | 1.0 |
| test_nr_of_bounds.cpp:62:19:62:19 | X | 1.0 |
| test_nr_of_bounds.cpp:63:5:63:19 | ... & ... | 8388608.0 |
| test_nr_of_bounds.cpp:63:5:63:19 | ... -= ... | 8388608.0 |
| test_nr_of_bounds.cpp:63:5:63:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:63:5:63:20 | (...) | 8388608.0 |
| test_nr_of_bounds.cpp:63:5:63:20 | x | 8388608.0 |
| test_nr_of_bounds.cpp:63:5:63:20 | x | 8388608.0 |
| test_nr_of_bounds.cpp:63:19:63:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:63:19:63:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:63:19:63:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:63:19:63:19 | Y | 1.0 |
| test_nr_of_bounds.cpp:63:19:63:19 | Y | 1.0 |
| test_nr_of_bounds.cpp:63:19:63:19 | Y | 1.0 |
| test_nr_of_bounds.cpp:64:5:64:19 | ... & ... | 1.6777216E7 |
| test_nr_of_bounds.cpp:64:5:64:19 | ... -= ... | 1.6777216E7 |
| test_nr_of_bounds.cpp:64:5:64:19 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:64:5:64:20 | (...) | 1.6777216E7 |
| test_nr_of_bounds.cpp:64:5:64:20 | x | 1.6777216E7 |
| test_nr_of_bounds.cpp:64:5:64:20 | x | 1.6777216E7 |
| test_nr_of_bounds.cpp:64:19:64:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:64:19:64:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:64:19:64:19 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:64:19:64:19 | Z | 1.0 |
| test_nr_of_bounds.cpp:64:19:64:19 | Z | 1.0 |
| test_nr_of_bounds.cpp:64:19:64:19 | Z | 1.0 |
| test_nr_of_bounds.cpp:65:5:65:20 | ... & ... | 3.3554432E7 |
| test_nr_of_bounds.cpp:65:5:65:20 | ... -= ... | 3.3554432E7 |
| test_nr_of_bounds.cpp:65:5:65:20 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:65:5:65:21 | (...) | 3.3554432E7 |
| test_nr_of_bounds.cpp:65:5:65:21 | x | 3.3554432E7 |
| test_nr_of_bounds.cpp:65:5:65:21 | x | 3.3554432E7 |
| test_nr_of_bounds.cpp:65:19:65:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:65:19:65:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:65:19:65:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:65:19:65:20 | AA | 1.0 |
| test_nr_of_bounds.cpp:65:19:65:20 | AA | 1.0 |
| test_nr_of_bounds.cpp:65:19:65:20 | AA | 1.0 |
| test_nr_of_bounds.cpp:66:5:66:20 | ... & ... | 6.7108864E7 |
| test_nr_of_bounds.cpp:66:5:66:20 | ... -= ... | 6.7108864E7 |
| test_nr_of_bounds.cpp:66:5:66:20 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:66:5:66:21 | (...) | 6.7108864E7 |
| test_nr_of_bounds.cpp:66:5:66:21 | x | 6.7108864E7 |
| test_nr_of_bounds.cpp:66:5:66:21 | x | 6.7108864E7 |
| test_nr_of_bounds.cpp:66:19:66:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:66:19:66:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:66:19:66:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:66:19:66:20 | AB | 1.0 |
| test_nr_of_bounds.cpp:66:19:66:20 | AB | 1.0 |
| test_nr_of_bounds.cpp:66:19:66:20 | AB | 1.0 |
| test_nr_of_bounds.cpp:67:5:67:20 | ... & ... | 1.34217728E8 |
| test_nr_of_bounds.cpp:67:5:67:20 | ... -= ... | 1.34217728E8 |
| test_nr_of_bounds.cpp:67:5:67:20 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:67:5:67:21 | (...) | 1.34217728E8 |
| test_nr_of_bounds.cpp:67:5:67:21 | x | 1.34217728E8 |
| test_nr_of_bounds.cpp:67:5:67:21 | x | 1.34217728E8 |
| test_nr_of_bounds.cpp:67:19:67:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:67:19:67:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:67:19:67:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:67:19:67:20 | AC | 1.0 |
| test_nr_of_bounds.cpp:67:19:67:20 | AC | 1.0 |
| test_nr_of_bounds.cpp:67:19:67:20 | AC | 1.0 |
| test_nr_of_bounds.cpp:68:5:68:20 | ... & ... | 2.68435456E8 |
| test_nr_of_bounds.cpp:68:5:68:20 | ... -= ... | 2.68435456E8 |
| test_nr_of_bounds.cpp:68:5:68:20 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:68:5:68:21 | (...) | 2.68435456E8 |
| test_nr_of_bounds.cpp:68:5:68:21 | x | 2.68435456E8 |
| test_nr_of_bounds.cpp:68:5:68:21 | x | 2.68435456E8 |
| test_nr_of_bounds.cpp:68:19:68:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:68:19:68:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:68:19:68:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:68:19:68:20 | AD | 1.0 |
| test_nr_of_bounds.cpp:68:19:68:20 | AD | 1.0 |
| test_nr_of_bounds.cpp:68:19:68:20 | AD | 1.0 |
| test_nr_of_bounds.cpp:69:5:69:20 | ... & ... | 5.36870912E8 |
| test_nr_of_bounds.cpp:69:5:69:20 | ... -= ... | 5.36870912E8 |
| test_nr_of_bounds.cpp:69:5:69:20 | ... == ... | 1.0 |
| test_nr_of_bounds.cpp:69:5:69:21 | (...) | 5.36870912E8 |
| test_nr_of_bounds.cpp:69:5:69:21 | x | 5.36870912E8 |
| test_nr_of_bounds.cpp:69:5:69:21 | x | 5.36870912E8 |
| test_nr_of_bounds.cpp:69:19:69:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:69:19:69:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:69:19:69:20 | (unsigned int)... | 1.0 |
| test_nr_of_bounds.cpp:69:19:69:20 | AE | 1.0 |
| test_nr_of_bounds.cpp:69:19:69:20 | AE | 1.0 |
| test_nr_of_bounds.cpp:69:19:69:20 | AE | 1.0 |
| test_nr_of_bounds.cpp:72:12:72:12 | x | 1.073741824E9 |

View File

@@ -14,8 +14,14 @@ private predicate nonFunctionalNrOfBounds(Expr e) {
strictcount(SimpleRangeAnalysisInternal::estimateNrOfBounds(e)) > 1
}
private predicate nrOfBoundsNotEq1(Expr e, int n) {
e.getFile().getBaseName() = "test_nr_of_bounds.cpp" and
n = count(SimpleRangeAnalysisInternal::estimateNrOfBounds(e)) and
n != 1
}
module FunctionalityTest implements TestSig {
string getARelevantTag() { result = "nonFunctionalNrOfBounds" }
string getARelevantTag() { result = ["nonFunctionalNrOfBounds", "bounds"] }
predicate hasActualResult(Location location, string element, string tag, string value) {
exists(Expr e |
@@ -25,6 +31,14 @@ module FunctionalityTest implements TestSig {
tag = "nonFunctionalNrOfBounds" and
value = ""
)
or
exists(Expr e, int n |
nrOfBoundsNotEq1(e, n) and
location = e.getLocation() and
element = e.toString() and
tag = "bounds" and
value = n.toString()
)
}
}

View File

@@ -972,3 +972,15 @@ void test_overflow() {
out(y);
}
}
enum MY_ENUM_2 {
A = 0x1,
B = 0x2,
C = 0x4,
D = 0x8,
E = 0x10
};
void test_enum(enum MY_ENUM_2 e) {
out(e);
}

View File

@@ -0,0 +1,73 @@
enum MY_ENUM {
A = 0x1,
B = 0x2,
C = 0x4,
D = 0x8,
E = 0x10,
F = 0x20,
G = 0x40,
H = 0x80,
I = 0x100,
J = 0x200,
L = 0x400,
M = 0x800,
N = 0x1000,
O = 0x2000,
P = 0x4000,
Q = 0x8000,
R = 0x10000,
S = 0x20000,
T = 0x40000,
U = 0x80000,
V = 0x100000,
W = 0x200000,
X = 0x400000,
Y = 0x800000,
Z = 0x1000000,
AA = 0x2000000,
AB = 0x4000000,
AC = 0x8000000,
AD = 0x10000000,
AE = 0x20000000
};
typedef unsigned int MY_ENUM_FLAGS;
MY_ENUM_FLAGS check_and_subs(MY_ENUM_FLAGS x)
{
#define CHECK_AND_SUB(flag) if ((x & flag) == flag) { x -= flag; }
CHECK_AND_SUB(A);
CHECK_AND_SUB(B);
CHECK_AND_SUB(C);
CHECK_AND_SUB(D);
CHECK_AND_SUB(E);
CHECK_AND_SUB(F);
CHECK_AND_SUB(G);
CHECK_AND_SUB(H);
CHECK_AND_SUB(I);
CHECK_AND_SUB(J);
CHECK_AND_SUB(L);
CHECK_AND_SUB(M);
CHECK_AND_SUB(N);
CHECK_AND_SUB(O);
CHECK_AND_SUB(P);
CHECK_AND_SUB(Q);
CHECK_AND_SUB(R);
CHECK_AND_SUB(S);
CHECK_AND_SUB(T);
CHECK_AND_SUB(U);
CHECK_AND_SUB(V);
CHECK_AND_SUB(W);
CHECK_AND_SUB(X);
CHECK_AND_SUB(Y);
CHECK_AND_SUB(Z);
CHECK_AND_SUB(AA);
CHECK_AND_SUB(AB);
CHECK_AND_SUB(AC);
CHECK_AND_SUB(AD);
CHECK_AND_SUB(AE);
#undef CHECK_AND_SUB
return x;
}

View File

@@ -1025,6 +1025,7 @@
| test.c:970:12:970:12 | y | 256 |
| test.c:971:9:971:9 | x | 2147483647 |
| test.c:972:9:972:9 | y | 256 |
| test.c:985:7:985:7 | e | 2147483647 |
| test.cpp:10:7:10:7 | b | 2147483647 |
| test.cpp:11:5:11:5 | x | 2147483647 |
| test.cpp:13:10:13:10 | x | 2147483647 |
@@ -1093,3 +1094,64 @@
| test.cpp:122:4:122:4 | n | 32767 |
| test.cpp:122:8:122:8 | n | 0 |
| test.cpp:122:12:122:12 | n | 32767 |
| test_nr_of_bounds.cpp:40:5:40:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:40:5:40:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:41:5:41:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:41:5:41:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:42:5:42:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:42:5:42:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:43:5:43:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:43:5:43:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:44:5:44:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:44:5:44:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:45:5:45:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:45:5:45:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:46:5:46:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:46:5:46:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:47:5:47:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:47:5:47:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:48:5:48:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:48:5:48:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:49:5:49:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:49:5:49:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:50:5:50:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:50:5:50:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:51:5:51:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:51:5:51:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:52:5:52:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:52:5:52:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:53:5:53:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:53:5:53:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:54:5:54:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:54:5:54:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:55:5:55:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:55:5:55:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:56:5:56:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:56:5:56:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:57:5:57:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:57:5:57:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:58:5:58:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:58:5:58:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:59:5:59:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:59:5:59:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:60:5:60:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:60:5:60:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:61:5:61:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:61:5:61:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:62:5:62:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:62:5:62:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:63:5:63:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:63:5:63:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:64:5:64:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:64:5:64:20 | x | 4294967295 |
| test_nr_of_bounds.cpp:65:5:65:21 | x | 4294967295 |
| test_nr_of_bounds.cpp:65:5:65:21 | x | 4294967295 |
| test_nr_of_bounds.cpp:66:5:66:21 | x | 4294967295 |
| test_nr_of_bounds.cpp:66:5:66:21 | x | 4294967295 |
| test_nr_of_bounds.cpp:67:5:67:21 | x | 4294967295 |
| test_nr_of_bounds.cpp:67:5:67:21 | x | 4294967295 |
| test_nr_of_bounds.cpp:68:5:68:21 | x | 4294967295 |
| test_nr_of_bounds.cpp:68:5:68:21 | x | 4294967295 |
| test_nr_of_bounds.cpp:69:5:69:21 | x | 4294967295 |
| test_nr_of_bounds.cpp:69:5:69:21 | x | 4294967295 |
| test_nr_of_bounds.cpp:72:12:72:12 | x | 4294967295 |

View File

@@ -44,5 +44,5 @@ NHibernate,3,,,,,,,,,,,,3,,,,,,,,,,
Newtonsoft.Json,,,91,,,,,,,,,,,,,,,,,,,73,18
ServiceStack,194,,7,27,,,,,75,,,,92,,,,,,,,,7,
SourceGenerators,,,5,,,,,,,,,,,,,,,,,,,,5
System,59,47,12491,,6,5,12,,,4,1,,31,2,,6,15,17,4,3,,6378,6113
System,59,47,12495,,6,5,12,,,4,1,,31,2,,6,15,17,4,3,,6382,6113
Windows.Security.Cryptography.Core,1,,,,,,,1,,,,,,,,,,,,,,,
1 package sink source summary sink:code-injection sink:encryption-decryptor sink:encryption-encryptor sink:encryption-keyprop sink:encryption-symmetrickey sink:file-content-store sink:html-injection sink:js-injection sink:log-injection sink:sql-injection source:commandargs source:database source:environment source:file source:file-write source:remote source:stdin source:windows-registry summary:taint summary:value
44 Newtonsoft.Json 91 73 18
45 ServiceStack 194 7 27 75 92 7
46 SourceGenerators 5 5
47 System 59 47 12491 12495 6 5 12 4 1 31 2 6 15 17 4 3 6378 6382 6113
48 Windows.Security.Cryptography.Core 1 1

View File

@@ -8,7 +8,7 @@ C# framework & library support
Framework / library,Package,Flow sources,Taint & value steps,Sinks (total),`CWE-079` :sub:`Cross-site scripting`
`ServiceStack <https://servicestack.net/>`_,"``ServiceStack.*``, ``ServiceStack``",,7,194,
System,"``System.*``, ``System``",47,12491,59,5
System,"``System.*``, ``System``",47,12495,59,5
Others,"``Amazon.Lambda.APIGatewayEvents``, ``Amazon.Lambda.Core``, ``Dapper``, ``ILCompiler``, ``ILLink.RoslynAnalyzer``, ``ILLink.Shared``, ``ILLink.Tasks``, ``Internal.IL``, ``Internal.Pgo``, ``Internal.TypeSystem``, ``Microsoft.ApplicationBlocks.Data``, ``Microsoft.AspNetCore.Components``, ``Microsoft.AspNetCore.Http``, ``Microsoft.AspNetCore.Mvc``, ``Microsoft.AspNetCore.WebUtilities``, ``Microsoft.CSharp``, ``Microsoft.Data.SqlClient``, ``Microsoft.Diagnostics.Tools.Pgo``, ``Microsoft.DotNet.Build.Tasks``, ``Microsoft.DotNet.PlatformAbstractions``, ``Microsoft.EntityFrameworkCore``, ``Microsoft.Extensions.Caching.Distributed``, ``Microsoft.Extensions.Caching.Memory``, ``Microsoft.Extensions.Configuration``, ``Microsoft.Extensions.DependencyInjection``, ``Microsoft.Extensions.DependencyModel``, ``Microsoft.Extensions.Diagnostics.Metrics``, ``Microsoft.Extensions.FileProviders``, ``Microsoft.Extensions.FileSystemGlobbing``, ``Microsoft.Extensions.Hosting``, ``Microsoft.Extensions.Http``, ``Microsoft.Extensions.Logging``, ``Microsoft.Extensions.Options``, ``Microsoft.Extensions.Primitives``, ``Microsoft.Interop``, ``Microsoft.JSInterop``, ``Microsoft.NET.Build.Tasks``, ``Microsoft.VisualBasic``, ``Microsoft.Win32``, ``Mono.Linker``, ``MySql.Data.MySqlClient``, ``NHibernate``, ``Newtonsoft.Json``, ``SourceGenerators``, ``Windows.Security.Cryptography.Core``",60,2406,162,4
Totals,,107,14904,415,9
Totals,,107,14908,415,9

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
description: Remove the relation `extension_receiver_type` and remove the `extension_type` type kind.
compatibility: backwards
extension_receiver_type.rel: delete

View File

@@ -5,6 +5,7 @@ using System.Security.Cryptography.X509Certificates;
using Semmle.Util;
using Semmle.Util.Logging;
using Newtonsoft.Json;
using System.Linq;
namespace Semmle.Extraction.CSharp.DependencyFetching
{
@@ -37,7 +38,8 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
/// </summary>
internal X509Certificate2? Certificate { get; private set; }
internal static DependabotProxy? GetDependabotProxy(ILogger logger, TemporaryDirectory tempWorkingDirectory)
internal static DependabotProxy? GetDependabotProxy(
ILogger logger, IDiagnosticsWriter diagnosticsWriter, TemporaryDirectory tempWorkingDirectory)
{
// Setting HTTP(S)_PROXY and SSL_CERT_FILE have no effect on Windows or macOS,
// but we would still end up using the Dependabot proxy to check for feed reachability.
@@ -112,6 +114,23 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
}
}
// Emit a diagnostic for the discovered private registries, so that it is easy
// for users to see that they were picked up.
if (result.RegistryURLs.Count > 0)
{
diagnosticsWriter.AddEntry(new DiagnosticMessage(
Language.CSharp,
"buildless/analysis-using-private-registries",
severity: DiagnosticMessage.TspSeverity.Note,
visibility: new DiagnosticMessage.TspVisibility(true, true, true),
name: "C# extraction used private package registries",
markdownMessage: string.Format(
"C# was extracted using the following private package registries:\n\n{0}\n",
string.Join("\n", result.RegistryURLs.Select(url => string.Format("- `{0}`", url)))
)
));
}
return result;
}

View File

@@ -106,7 +106,7 @@ namespace Semmle.Extraction.CSharp.DependencyFetching
return BuildScript.Success;
}).Run(SystemBuildActions.Instance, startCallback, exitCallback);
dependabotProxy = DependabotProxy.GetDependabotProxy(logger, tempWorkingDirectory);
dependabotProxy = DependabotProxy.GetDependabotProxy(logger, diagnosticsWriter, tempWorkingDirectory);
try
{

View File

@@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using Microsoft.CodeAnalysis;
using Semmle.Util;
using Semmle.Extraction.CSharp.Entities;
namespace Semmle.Extraction.CSharp
@@ -164,6 +165,7 @@ namespace Semmle.Extraction.CSharp
case TypeKind.Enum:
case TypeKind.Delegate:
case TypeKind.Error:
case TypeKind.Extension:
var named = (INamedTypeSymbol)type;
named.BuildNamedTypeId(cx, trapFile, symbolBeingDefined, constructUnderlyingTupleType);
return;
@@ -275,6 +277,20 @@ namespace Semmle.Extraction.CSharp
public static IEnumerable<IFieldSymbol?> GetTupleElementsMaybeNull(this INamedTypeSymbol type) =>
type.TupleElements;
private static void BuildExtensionTypeId(this INamedTypeSymbol named, Context cx, EscapingTextWriter trapFile)
{
trapFile.Write("extension(");
if (named.ExtensionMarkerName is not null)
{
trapFile.Write(named.ExtensionMarkerName);
}
else
{
trapFile.Write("unknown");
}
trapFile.Write(")");
}
private static void BuildQualifierAndName(INamedTypeSymbol named, Context cx, EscapingTextWriter trapFile, ISymbol symbolBeingDefined)
{
if (named.ContainingType is not null)
@@ -289,8 +305,18 @@ namespace Semmle.Extraction.CSharp
named.ContainingNamespace.BuildNamespace(cx, trapFile);
}
var name = named.IsFileLocal ? named.MetadataName : named.Name;
trapFile.Write(name);
if (named.IsFileLocal)
{
trapFile.Write(named.MetadataName);
}
else if (named.IsExtension)
{
named.BuildExtensionTypeId(cx, trapFile);
}
else
{
trapFile.Write(named.Name);
}
}
private static void BuildTupleId(INamedTypeSymbol named, Context cx, EscapingTextWriter trapFile, ISymbol symbolBeingDefined)
@@ -391,6 +417,7 @@ namespace Semmle.Extraction.CSharp
case TypeKind.Enum:
case TypeKind.Delegate:
case TypeKind.Error:
case TypeKind.Extension:
var named = (INamedTypeSymbol)type;
named.BuildNamedTypeDisplayName(cx, trapFile, constructUnderlyingTupleType);
return;
@@ -465,6 +492,20 @@ namespace Semmle.Extraction.CSharp
private static void BuildFunctionPointerTypeDisplayName(this IFunctionPointerTypeSymbol funptr, Context cx, TextWriter trapFile) =>
BuildFunctionPointerSignature(funptr, trapFile, s => s.BuildDisplayName(cx, trapFile));
private static void BuildExtensionTypeDisplayName(this INamedTypeSymbol named, Context cx, TextWriter trapFile)
{
trapFile.Write("extension(");
if (named.ExtensionParameter?.Type is ITypeSymbol type)
{
type.BuildDisplayName(cx, trapFile);
}
else
{
trapFile.Write("unknown");
}
trapFile.Write(")");
}
private static void BuildNamedTypeDisplayName(this INamedTypeSymbol namedType, Context cx, TextWriter trapFile, bool constructUnderlyingTupleType)
{
if (!constructUnderlyingTupleType && namedType.IsTupleType)
@@ -484,6 +525,12 @@ namespace Semmle.Extraction.CSharp
return;
}
if (namedType.IsExtension)
{
namedType.BuildExtensionTypeDisplayName(cx, trapFile);
return;
}
if (namedType.IsAnonymousType)
{
namedType.BuildAnonymousName(cx, trapFile);
@@ -596,6 +643,84 @@ namespace Semmle.Extraction.CSharp
return true;
}
/// <summary>
/// Return true if this method is a compiler-generated extension method.
/// </summary>
public static bool IsCompilerGeneratedExtensionMethod(this IMethodSymbol method) =>
method.TryGetExtensionMethod() is not null;
/// <summary>
/// Returns the extension method corresponding to this compiler-generated extension method, if it exists.
/// </summary>
public static IMethodSymbol? TryGetExtensionMethod(this IMethodSymbol method)
{
if (method.IsImplicitlyDeclared && method.ContainingSymbol is INamedTypeSymbol containingType)
{
// Extension types are declared within the same type as the generated
// extension method implementation.
var extensions = containingType.GetMembers()
.OfType<INamedTypeSymbol>()
.Where(t => t.IsExtension);
// Find the (possibly unbound) original extension method that maps to this implementation (if any).
var unboundDeclaration = extensions.SelectMany(e => e.GetMembers())
.OfType<IMethodSymbol>()
.FirstOrDefault(m => SymbolEqualityComparer.Default.Equals(m.AssociatedExtensionImplementation, method.ConstructedFrom));
var isFullyConstructed = method.IsBoundGenericMethod();
if (isFullyConstructed && unboundDeclaration?.ContainingType is INamedTypeSymbol extensionType)
{
try
{
// Use the type arguments from the constructed extension method to construct the extension type.
var arguments = method.TypeArguments.ToArray();
var (extensionTypeArguments, extensionMethodArguments) = arguments.SplitAt(extensionType.TypeParameters.Length);
// Construct the extension type.
var boundExtensionType = extensionType.IsUnboundGenericType()
? extensionType.Construct(extensionTypeArguments.ToArray())
: extensionType;
// Find the extension method declaration within the constructed extension type.
var extensionDeclaration = boundExtensionType.GetMembers()
.OfType<IMethodSymbol>()
.First(c => SymbolEqualityComparer.Default.Equals(c.OriginalDefinition, unboundDeclaration));
// If the extension declaration is unbound apply the remaning type arguments and construct it.
return extensionDeclaration.IsUnboundGenericMethod()
? extensionDeclaration.Construct(extensionMethodArguments.ToArray())
: extensionDeclaration;
}
catch
{
// If anything goes wrong, fall back to the unbound declaration.
return unboundDeclaration;
}
}
else
{
return unboundDeclaration;
}
}
return null;
}
/// <summary>
/// Returns true if this method is an unbound generic method.
/// </summary>
public static bool IsUnboundGenericMethod(this IMethodSymbol method) =>
method.IsGenericMethod && SymbolEqualityComparer.Default.Equals(method.ConstructedFrom, method);
/// <summary>
/// Returns true if this method is a bound generic method.
/// </summary>
public static bool IsBoundGenericMethod(this IMethodSymbol method) => method.IsGenericMethod && !method.IsUnboundGenericMethod();
/// <summary>
/// Returns true if this type is an unbound generic type.
/// </summary>
public static bool IsUnboundGenericType(this INamedTypeSymbol type) =>
type.IsGenericType && SymbolEqualityComparer.Default.Equals(type.ConstructedFrom, type);
/// <summary>
/// Gets the base type of `symbol`. Unlike `symbol.BaseType`, this excludes effective base
/// types of type parameters as well as `object` base types.
@@ -692,5 +817,35 @@ namespace Semmle.Extraction.CSharp
/// </summary>
public static IEnumerable<T> ExtractionCandidates<T>(this IEnumerable<T> symbols) where T : ISymbol =>
symbols.Where(symbol => symbol.ShouldExtractSymbol());
/// <summary>
/// Returns the parameter kind for this parameter symbol, e.g. `ref`, `out`, `params`, etc.
/// </summary>
public static Parameter.Kind GetParameterKind(this IParameterSymbol parameter)
{
switch (parameter.RefKind)
{
case RefKind.Out:
return Parameter.Kind.Out;
case RefKind.Ref:
return Parameter.Kind.Ref;
case RefKind.In:
return Parameter.Kind.In;
case RefKind.RefReadOnlyParameter:
return Parameter.Kind.RefReadOnly;
default:
if (parameter.IsParams)
return Parameter.Kind.Params;
if (parameter.Ordinal == 0)
{
if (parameter.ContainingSymbol is IMethodSymbol method && method.IsExtensionMethod)
{
return Parameter.Kind.This;
}
}
return Parameter.Kind.None;
}
}
}
}

View File

@@ -54,22 +54,6 @@ namespace Semmle.Extraction.CSharp.Entities
}
}
protected static void WriteLocationToTrap<T1>(Action<T1, Location> writeAction, T1 entity, Location l)
{
if (l is not EmptyLocation)
{
writeAction(entity, l);
}
}
protected static void WriteLocationsToTrap<T1>(Action<T1, Location> writeAction, T1 entity, IEnumerable<Location> locations)
{
foreach (var loc in locations)
{
WriteLocationToTrap(writeAction, entity, loc);
}
}
public override bool NeedsPopulation { get; }
public override int GetHashCode() => Symbol is null ? 0 : Symbol.GetHashCode();

View File

@@ -32,32 +32,6 @@ namespace Semmle.Extraction.CSharp.Entities
Attribute.ExtractAttributes(Context, Symbol, this);
}
protected void PopulateNullability(TextWriter trapFile, AnnotatedTypeSymbol type)
{
var n = NullabilityEntity.Create(Context, Nullability.Create(type));
if (!type.HasObliviousNullability())
{
trapFile.type_nullability(this, n);
}
}
protected void PopulateRefKind(TextWriter trapFile, RefKind kind)
{
switch (kind)
{
case RefKind.Out:
trapFile.type_annotation(this, Kinds.TypeAnnotation.Out);
break;
case RefKind.Ref:
trapFile.type_annotation(this, Kinds.TypeAnnotation.Ref);
break;
case RefKind.RefReadOnly:
case RefKind.RefReadOnlyParameter:
trapFile.type_annotation(this, Kinds.TypeAnnotation.ReadonlyRef);
break;
}
}
protected void PopulateScopedKind(TextWriter trapFile, ScopedKind kind)
{
switch (kind)

View File

@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.CodeAnalysis;
using Semmle.Extraction.CSharp.Entities;
namespace Semmle.Extraction.CSharp
{
@@ -24,7 +26,7 @@ namespace Semmle.Extraction.CSharp
trapFile.WriteUnescaped('\"');
}
public abstract Location? ReportingLocation { get; }
public abstract Microsoft.CodeAnalysis.Location? ReportingLocation { get; }
public abstract TrapStackBehaviour TrapStackBehaviour { get; }
@@ -65,6 +67,48 @@ namespace Semmle.Extraction.CSharp
}
#endif
protected void PopulateRefKind(TextWriter trapFile, RefKind kind)
{
switch (kind)
{
case RefKind.Out:
trapFile.type_annotation(this, Kinds.TypeAnnotation.Out);
break;
case RefKind.Ref:
trapFile.type_annotation(this, Kinds.TypeAnnotation.Ref);
break;
case RefKind.RefReadOnly:
case RefKind.RefReadOnlyParameter:
trapFile.type_annotation(this, Kinds.TypeAnnotation.ReadonlyRef);
break;
}
}
protected void PopulateNullability(TextWriter trapFile, AnnotatedTypeSymbol type)
{
var n = NullabilityEntity.Create(Context, Nullability.Create(type));
if (!type.HasObliviousNullability())
{
trapFile.type_nullability(this, n);
}
}
protected static void WriteLocationToTrap<T1>(Action<T1, Entities.Location> writeAction, T1 entity, Entities.Location l)
{
if (l is not EmptyLocation)
{
writeAction(entity, l);
}
}
protected static void WriteLocationsToTrap<T1>(Action<T1, Entities.Location> writeAction, T1 entity, IEnumerable<Entities.Location> locations)
{
foreach (var loc in locations)
{
WriteLocationToTrap(writeAction, entity, loc);
}
}
public override string ToString() => Label.ToString();
}
}

View File

@@ -24,6 +24,16 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
private bool IsExplicitDelegateInvokeCall() => Kind == ExprKind.DELEGATE_INVOCATION && Context.GetModel(Syntax.Expression).GetSymbolInfo(Syntax.Expression).Symbol is IMethodSymbol m && m.MethodKind == MethodKind.DelegateInvoke;
private bool IsOperatorCall() => Kind == ExprKind.OPERATOR_INVOCATION;
private bool IsValidMemberAccessKind()
{
return Kind == ExprKind.METHOD_INVOCATION ||
IsEventDelegateCall() ||
IsExplicitDelegateInvokeCall() ||
IsOperatorCall();
}
protected override void PopulateExpression(TextWriter trapFile)
{
if (IsNameof(Syntax))
@@ -37,7 +47,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
var target = TargetSymbol;
switch (Syntax.Expression)
{
case MemberAccessExpressionSyntax memberAccess when Kind == ExprKind.METHOD_INVOCATION || IsEventDelegateCall() || IsExplicitDelegateInvokeCall():
case MemberAccessExpressionSyntax memberAccess when IsValidMemberAccessKind():
memberName = memberAccess.Name.Identifier.Text;
if (Syntax.Expression.Kind() == SyntaxKind.SimpleMemberAccessExpression)
// Qualified method call; `x.M()`
@@ -113,14 +123,24 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
public SymbolInfo SymbolInfo => info.SymbolInfo;
private static bool IsOperatorLikeCall(ExpressionNodeInfo info)
{
return info.SymbolInfo.Symbol is IMethodSymbol method &&
method.TryGetExtensionMethod()?.MethodKind == MethodKind.UserDefinedOperator;
}
public IMethodSymbol? TargetSymbol
{
get
{
var si = SymbolInfo;
if (si.Symbol is not null)
return si.Symbol as IMethodSymbol;
if (si.Symbol is ISymbol symbol)
{
var method = symbol as IMethodSymbol;
// Case for compiler-generated extension methods.
return method?.TryGetExtensionMethod() ?? method;
}
if (si.CandidateReason == CandidateReason.OverloadResolutionFailure)
{
@@ -196,15 +216,25 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
private static ExprKind GetKind(ExpressionNodeInfo info)
{
return IsNameof((InvocationExpressionSyntax)info.Node)
? ExprKind.NAMEOF
: IsDelegateLikeCall(info)
? IsDelegateInvokeCall(info)
? ExprKind.DELEGATE_INVOCATION
: ExprKind.FUNCTION_POINTER_INVOCATION
: IsLocalFunctionInvocation(info)
? ExprKind.LOCAL_FUNCTION_INVOCATION
: ExprKind.METHOD_INVOCATION;
if (IsNameof((InvocationExpressionSyntax)info.Node))
{
return ExprKind.NAMEOF;
}
if (IsDelegateLikeCall(info))
{
return IsDelegateInvokeCall(info)
? ExprKind.DELEGATE_INVOCATION
: ExprKind.FUNCTION_POINTER_INVOCATION;
}
if (IsLocalFunctionInvocation(info))
{
return ExprKind.LOCAL_FUNCTION_INVOCATION;
}
if (IsOperatorLikeCall(info))
{
return ExprKind.OPERATOR_INVOCATION;
}
return ExprKind.METHOD_INVOCATION;
}
private static bool IsNameof(InvocationExpressionSyntax syntax)

View File

@@ -0,0 +1,9 @@
namespace Semmle.Extraction.CSharp.Entities
{
/// <summary>
/// Marker interface for parameter entities.
/// </summary>
internal interface IParameter : IEntity
{
}
}

View File

@@ -14,9 +14,28 @@ namespace Semmle.Extraction.CSharp.Entities
protected Method(Context cx, IMethodSymbol init)
: base(cx, init) { }
private SyntheticExtensionParameter? SyntheticParameter { get; set; }
private int SynthesizeExtensionParameter()
{
// Synthesize implicit parameter for extension methods declared using extension(...) syntax.
if (Symbol.ContainingSymbol is INamedTypeSymbol type &&
type.IsExtension && type.ExtensionParameter is IParameterSymbol parameter &&
!string.IsNullOrEmpty(parameter.Name) && !Symbol.IsStatic)
{
var originalSyntheticParam = OriginalDefinition.SyntheticParameter;
SyntheticParameter = SyntheticExtensionParameter.Create(Context, this, parameter, originalSyntheticParam);
return 1;
}
return 0;
}
protected void PopulateParameters()
{
var originalMethod = OriginalDefinition;
var positionOffset = SynthesizeExtensionParameter();
IEnumerable<IParameterSymbol> parameters = Symbol.Parameters;
IEnumerable<IParameterSymbol> originalParameters = originalMethod.Symbol.Parameters;
@@ -24,8 +43,8 @@ namespace Semmle.Extraction.CSharp.Entities
{
var original = SymbolEqualityComparer.Default.Equals(p.paramSymbol, p.originalParam)
? null
: Parameter.Create(Context, p.originalParam, originalMethod);
Parameter.Create(Context, p.paramSymbol, this, original);
: Parameter.Create(Context, p.originalParam, originalMethod, null, positionOffset);
Parameter.Create(Context, p.paramSymbol, this, original, positionOffset);
}
if (Symbol.IsVararg)
@@ -302,9 +321,9 @@ namespace Semmle.Extraction.CSharp.Entities
/// <summary>
/// Whether this method has unbound type parameters.
/// </summary>
public bool IsUnboundGeneric => IsGeneric && SymbolEqualityComparer.Default.Equals(Symbol.ConstructedFrom, Symbol);
public bool IsUnboundGeneric => Symbol.IsUnboundGenericMethod();
public bool IsBoundGeneric => IsGeneric && !IsUnboundGeneric;
public bool IsBoundGeneric => Symbol.IsBoundGenericMethod();
protected IMethodSymbol ConstructedFromSymbol => Symbol.ConstructedFrom;

View File

@@ -23,7 +23,11 @@ namespace Semmle.Extraction.CSharp.Entities
? Symbol.ContainingType.GetSymbolLocation()
: BodyDeclaringSymbol.GetSymbolLocation();
public override bool NeedsPopulation => base.NeedsPopulation || IsCompilerGeneratedDelegate();
public override bool NeedsPopulation =>
(base.NeedsPopulation || IsCompilerGeneratedDelegate()) &&
// Exclude compiler-generated extension methods. A call to such a method
// is replaced by a call to the defining extension method.
!Symbol.IsCompilerGeneratedExtensionMethod();
public override void Populate(TextWriter trapFile)
{

View File

@@ -7,16 +7,23 @@ using Semmle.Extraction.CSharp.Populators;
namespace Semmle.Extraction.CSharp.Entities
{
internal class Parameter : CachedSymbol<IParameterSymbol>, IExpressionParentEntity
internal class Parameter : CachedSymbol<IParameterSymbol>, IExpressionParentEntity, IParameter
{
protected IEntity? Parent { get; set; }
protected Parameter Original { get; }
private int PositionOffset { get; set; }
protected Parameter(Context cx, IParameterSymbol init, IEntity? parent, Parameter? original)
private Parameter(Context cx, IParameterSymbol init, IEntity? parent, Parameter? original, int positionOffset)
: base(cx, init)
{
Parent = parent;
Original = original ?? this;
PositionOffset = positionOffset;
}
protected Parameter(Context cx, IParameterSymbol init, IEntity? parent, Parameter? original)
: this(cx, init, parent, original, 0)
{
}
public override Microsoft.CodeAnalysis.Location ReportingLocation => Symbol.GetSymbolLocation();
@@ -32,46 +39,18 @@ namespace Semmle.Extraction.CSharp.Entities
RefReadOnly = 6
}
protected virtual int Ordinal => Symbol.Ordinal;
protected virtual int Ordinal => Symbol.Ordinal + PositionOffset;
private Kind ParamKind
{
get
{
switch (Symbol.RefKind)
{
case RefKind.Out:
return Kind.Out;
case RefKind.Ref:
return Kind.Ref;
case RefKind.In:
return Kind.In;
case RefKind.RefReadOnlyParameter:
return Kind.RefReadOnly;
default:
if (Symbol.IsParams)
return Kind.Params;
if (Ordinal == 0)
{
if (Symbol.ContainingSymbol is IMethodSymbol method && method.IsExtensionMethod)
return Kind.This;
}
return Kind.None;
}
}
}
public static Parameter Create(Context cx, IParameterSymbol param, IEntity parent, Parameter? original = null)
public static Parameter Create(Context cx, IParameterSymbol param, IEntity parent, Parameter? original = null, int positionOffset = 0)
{
var cachedSymbol = cx.GetPossiblyCachedParameterSymbol(param);
return ParameterFactory.Instance.CreateEntity(cx, cachedSymbol, (cachedSymbol, parent, original));
return ParameterFactory.Instance.CreateEntity(cx, cachedSymbol, (cachedSymbol, parent, original, positionOffset));
}
public static Parameter Create(Context cx, IParameterSymbol param)
{
var cachedSymbol = cx.GetPossiblyCachedParameterSymbol(param);
return ParameterFactory.Instance.CreateEntity(cx, cachedSymbol, (cachedSymbol, null, null));
return ParameterFactory.Instance.CreateEntity(cx, cachedSymbol, (cachedSymbol, null, null, 0));
}
public override void WriteId(EscapingTextWriter trapFile)
@@ -79,6 +58,9 @@ namespace Semmle.Extraction.CSharp.Entities
if (Parent is null)
Parent = Method.Create(Context, Symbol.ContainingSymbol as IMethodSymbol);
if (Parent is null && Symbol.ContainingSymbol is INamedTypeSymbol type && type.IsExtension)
Parent = Type.Create(Context, type);
if (Parent is null)
throw new InternalError(Symbol, "Couldn't get parent of symbol.");
@@ -113,7 +95,8 @@ namespace Semmle.Extraction.CSharp.Entities
Context.ModelError(Symbol, "Inconsistent parameter declaration");
var type = Type.Create(Context, Symbol.Type);
trapFile.@params(this, Name, type.TypeRef, Ordinal, ParamKind, Parent!, Original);
var kind = Symbol.GetParameterKind();
trapFile.@params(this, Name, type.TypeRef, Ordinal, kind, Parent!, Original);
if (Context.OnlyScaffold)
{
@@ -194,11 +177,11 @@ namespace Semmle.Extraction.CSharp.Entities
return syntax?.Default;
}
private class ParameterFactory : CachedEntityFactory<(IParameterSymbol, IEntity?, Parameter?), Parameter>
private class ParameterFactory : CachedEntityFactory<(IParameterSymbol, IEntity?, Parameter?, int), Parameter>
{
public static ParameterFactory Instance { get; } = new ParameterFactory();
public override Parameter Create(Context cx, (IParameterSymbol, IEntity?, Parameter?) init) => new Parameter(cx, init.Item1, init.Item2, init.Item3);
public override Parameter Create(Context cx, (IParameterSymbol, IEntity?, Parameter?, int) init) => new Parameter(cx, init.Item1, init.Item2, init.Item3, init.Item4);
}
public override TrapStackBehaviour TrapStackBehaviour => TrapStackBehaviour.OptionalLabel;

View File

@@ -0,0 +1,77 @@
using System.IO;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
namespace Semmle.Extraction.CSharp.Entities
{
/// <summary>
/// Synthetic parameter for extension methods declared using the extension syntax.
/// That is, we add a synthetic parameter `s` to `IsValid` in the following example:
/// extension(string s) {
/// public bool IsValid() { ... }
/// }
///
/// Note, that we use the characteristics of the parameter of the extension type
/// to populate the database.
/// </summary>
internal class SyntheticExtensionParameter : FreshEntity, IParameter
{
private Method ExtensionMethod { get; }
private IParameterSymbol ExtensionParameter { get; }
private SyntheticExtensionParameter Original { get; }
private SyntheticExtensionParameter(Context cx, Method method, IParameterSymbol parameter, SyntheticExtensionParameter? original) : base(cx)
{
ExtensionMethod = method;
ExtensionParameter = parameter;
Original = original ?? this;
}
private static int Ordinal => 0;
private string Name => ExtensionParameter.Name;
private bool IsSourceDeclaration => ExtensionMethod.Symbol.IsSourceDeclaration();
protected override void Populate(TextWriter trapFile)
{
PopulateNullability(trapFile, ExtensionParameter.GetAnnotatedType());
PopulateRefKind(trapFile, ExtensionParameter.RefKind);
var type = Type.Create(Context, ExtensionParameter.Type);
var kind = ExtensionParameter.GetParameterKind();
trapFile.@params(this, Name, type.TypeRef, Ordinal, kind, ExtensionMethod, Original);
if (Context.OnlyScaffold)
{
return;
}
if (Context.ExtractLocation(ExtensionParameter))
{
var locations = Context.GetLocations(ExtensionParameter);
WriteLocationsToTrap(trapFile.param_location, this, locations);
}
if (IsSourceDeclaration)
{
foreach (var syntax in ExtensionParameter.DeclaringSyntaxReferences
.Select(d => d.GetSyntax())
.OfType<ParameterSyntax>()
.Where(s => s.Type is not null))
{
TypeMention.Create(Context, syntax.Type!, this, type);
}
}
}
public static SyntheticExtensionParameter Create(Context cx, Method method, IParameterSymbol parameter, SyntheticExtensionParameter? original)
{
var p = new SyntheticExtensionParameter(cx, method, parameter, original);
p.TryPopulate();
return p;
}
}
}

View File

@@ -20,6 +20,8 @@ namespace Semmle.Extraction.CSharp.Entities
public static NamedType Create(Context cx, INamedTypeSymbol type) =>
NamedTypeFactory.Instance.CreateEntityFromSymbol(cx, type);
public NamedType OriginalDefinition => Create(Context, Symbol.OriginalDefinition);
/// <summary>
/// Creates a named type entity from a tuple type. Unlike <see cref="Create"/>, this
/// will create an entity for the underlying `System.ValueTuple` struct.
@@ -90,6 +92,25 @@ namespace Semmle.Extraction.CSharp.Entities
{
trapFile.anonymous_types(this);
}
if (Symbol.IsExtension && Symbol.ExtensionParameter is IParameterSymbol parameter)
{
// For some reason an extension type has a receiver parameter with an empty name
// even when there is no parameter.
if (!string.IsNullOrEmpty(parameter.Name))
{
var originalType = OriginalDefinition;
// In case this is a constructed generic, we also need to create the unbound parameter.
var originalParameter = SymbolEqualityComparer.Default.Equals(Symbol, originalType.Symbol.ExtensionParameter) || originalType.Symbol.ExtensionParameter is null
? null
: Parameter.Create(Context, originalType.Symbol.ExtensionParameter, originalType);
Parameter.Create(Context, parameter, this, originalParameter);
}
// Use the parameter type as the receiver type.
var receiverType = Type.Create(Context, parameter.Type).TypeRef;
trapFile.extension_receiver_type(this, receiverType);
}
}
private readonly Lazy<Type[]> typeArgumentsLazy;

View File

@@ -105,6 +105,7 @@ namespace Semmle.Extraction.CSharp.Entities
case TypeKind.Pointer: return Kinds.TypeKind.POINTER;
case TypeKind.FunctionPointer: return Kinds.TypeKind.FUNCTION_POINTER;
case TypeKind.Error: return Kinds.TypeKind.UNKNOWN;
case TypeKind.Extension: return Kinds.TypeKind.EXTENSION;
default:
cx.ModelError(Symbol, $"Unhandled type kind '{Symbol.TypeKind}'");
return Kinds.TypeKind.UNKNOWN;
@@ -366,7 +367,7 @@ namespace Semmle.Extraction.CSharp.Entities
private DelegateTypeParameter(Context cx, IParameterSymbol init, IEntity parent, Parameter? original)
: base(cx, init, parent, original) { }
public static new DelegateTypeParameter Create(Context cx, IParameterSymbol param, IEntity parent, Parameter? original = null) =>
public static DelegateTypeParameter Create(Context cx, IParameterSymbol param, IEntity parent, Parameter? original = null) =>
// We need to use a different cache key than `param` to avoid mixing up
// `DelegateTypeParameter`s and `Parameter`s
DelegateTypeParameterFactory.Instance.CreateEntity(cx, (typeof(DelegateTypeParameter), new SymbolEqualityWrapper(param)), (param, parent, original));

View File

@@ -38,5 +38,6 @@ namespace Semmle.Extraction.Kinds
TUPLE = 32,
FUNCTION_POINTER = 33,
INLINE_ARRAY = 34,
EXTENSION = 35
}
}

View File

@@ -202,6 +202,9 @@ namespace Semmle.Extraction.CSharp
internal static void extend(this TextWriter trapFile, Type type, Type super) =>
trapFile.WriteTuple("extend", type, super);
internal static void extension_receiver_type(this TextWriter trapFile, Type @extension, Type receiverType) =>
trapFile.WriteTuple("extension_receiver_type", extension, receiverType);
internal static void anonymous_types(this TextWriter trapFile, Type type) =>
trapFile.WriteTuple("anonymous_types", type);
@@ -292,10 +295,10 @@ namespace Semmle.Extraction.CSharp
internal static void overrides(this TextWriter trapFile, Method overriding, Method overridden) =>
trapFile.WriteTuple("overrides", overriding, overridden);
internal static void param_location(this TextWriter trapFile, Parameter param, Location location) =>
internal static void param_location(this TextWriter trapFile, IParameter param, Location location) =>
trapFile.WriteTuple("param_location", param, location);
internal static void @params(this TextWriter trapFile, Parameter param, string name, Type type, int child, Parameter.Kind mode, IEntity method, Parameter originalDefinition) =>
internal static void @params(this TextWriter trapFile, IParameter param, string name, Type type, int child, Parameter.Kind mode, IEntity method, IParameter originalDefinition) =>
trapFile.WriteTuple("params", param, name, type, child, (int)mode, method, originalDefinition);
internal static void parent_namespace(this TextWriter trapFile, IEntity type, Namespace parent) =>

View File

@@ -119,5 +119,28 @@ namespace Semmle.Util
/// </summary>
public static IEnumerable<T> WhereNotNull<T>(this IEnumerable<T?> items) where T : class =>
items.Where(i => i is not null)!;
/// <summary>
/// Splits the sequence at the given index.
/// </summary>
public static (IEnumerable<T>, IEnumerable<T>) SplitAt<T>(this IEnumerable<T> items, int index)
{
var left = new List<T>();
var right = new List<T>();
var i = 0;
foreach (var item in items)
{
if (i < index)
{
left.Add(item);
}
else
{
right.Add(item);
}
i++;
}
return (left, right);
}
}
}

View File

@@ -1,3 +1,7 @@
## 1.7.59
No user-facing changes.
## 1.7.58
No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 1.7.59
No user-facing changes.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.7.58
lastReleaseVersion: 1.7.59

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-solorigate-all
version: 1.7.58
version: 1.7.59
groups:
- csharp
- solorigate

View File

@@ -1,3 +1,7 @@
## 1.7.59
No user-facing changes.
## 1.7.58
No user-facing changes.

View File

@@ -0,0 +1,3 @@
## 1.7.59
No user-facing changes.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.7.58
lastReleaseVersion: 1.7.59

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-solorigate-queries
version: 1.7.58
version: 1.7.59
groups:
- csharp
- solorigate

View File

@@ -1,3 +1,10 @@
## 5.4.7
### Minor Analysis Improvements
* The model for `System.Web.HttpUtility` has been modified to better model the flow of tainted URIs.
* C# 14: Added support for `extension` members in the extractor, QL library, data flow, and Models as Data, covering extension methods, properties, and operators.
## 5.4.6
### Minor Analysis Improvements

View File

@@ -0,0 +1,6 @@
## 5.4.7
### Minor Analysis Improvements
* The model for `System.Web.HttpUtility` has been modified to better model the flow of tainted URIs.
* C# 14: Added support for `extension` members in the extractor, QL library, data flow, and Models as Data, covering extension methods, properties, and operators.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 5.4.6
lastReleaseVersion: 5.4.7

View File

@@ -29,6 +29,10 @@ extensions:
- ["System.Web", "HttpUtility", False, "JavaScriptStringEncode", "(System.String)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Web", "HttpUtility", False, "JavaScriptStringEncode", "(System.String,System.Boolean)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Web", "HttpUtility", False, "ParseQueryString", "", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Web", "HttpUtility", False, "UrlDecode", "(System.Byte[],System.Int32,System.Int32,System.Text.Encoding)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Web", "HttpUtility", False, "UrlDecode", "(System.Byte[],System.Text.Encoding)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Web", "HttpUtility", False, "UrlDecode", "(System.String)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Web", "HttpUtility", False, "UrlDecode", "(System.String,System.Text.Encoding)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Web", "HttpUtility", False, "UrlEncode", "(System.Byte[])", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Web", "HttpUtility", False, "UrlEncode", "(System.Byte[],System.Int32,System.Int32)", "", "Argument[0]", "ReturnValue", "taint", "manual"]
- ["System.Web", "HttpUtility", False, "UrlEncode", "(System.String)", "", "Argument[0]", "ReturnValue", "taint", "manual"]

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-all
version: 5.4.6
version: 5.4.7
groups: csharp
dbscheme: semmlecode.csharp.dbscheme
extractor: csharp

View File

@@ -10,6 +10,7 @@ import exprs.Call
private import commons.QualifiedName
private import commons.Collections
private import semmle.code.csharp.ExprOrStmtParent
private import semmle.code.csharp.internal.Callable
private import semmle.code.csharp.metrics.Complexity
private import TypeRef
@@ -223,6 +224,8 @@ class Callable extends Parameterizable, ExprOrStmtParent, @callable {
Call getACall() { this = result.getTarget() }
}
final class ExtensionCallable = ExtensionCallableImpl;
/**
* A method, for example
*
@@ -267,8 +270,11 @@ class Method extends Callable, Virtualizable, Attributable, @method {
override Location getALocation() { method_location(this.getUnboundDeclaration(), result) }
/** Holds if this method is a classic extension method. */
predicate isClassicExtensionMethod() { this.getParameter(0).hasExtensionMethodModifier() }
/** Holds if this method is an extension method. */
predicate isExtensionMethod() { this.getParameter(0).hasExtensionMethodModifier() }
predicate isExtensionMethod() { this.isClassicExtensionMethod() or this.isInExtension() }
/** Gets the type of the `params` parameter of this method, if any. */
Type getParamsType() {
@@ -295,8 +301,10 @@ class Method extends Callable, Virtualizable, Attributable, @method {
override string getAPrimaryQlClass() { result = "Method" }
}
final class ExtensionMethod = ExtensionMethodImpl;
/**
* An extension method, for example
* An extension method, for example
*
* ```csharp
* static bool IsDefined(this Widget w) {
@@ -304,16 +312,28 @@ class Method extends Callable, Virtualizable, Attributable, @method {
* }
* ```
*/
class ExtensionMethod extends Method {
ExtensionMethod() { this.isExtensionMethod() }
class ClassicExtensionMethod extends ExtensionMethodImpl {
ClassicExtensionMethod() { this.isClassicExtensionMethod() }
pragma[noinline]
override Type getExtendedType() { result = this.getParameter(0).getType() }
override predicate isStatic() { any() }
}
/** Gets the type being extended by this method. */
pragma[noinline]
Type getExtendedType() { result = this.getParameter(0).getType() }
override string getAPrimaryQlClass() { result = "ExtensionMethod" }
/**
* An extension method declared in an extension type, for example `IsNullOrEmpty` in
*
* ```csharp
* static class MyExtensions {
* extension(string s) {
* public bool IsNullOrEmpty() { ... }
* }
* }
* ```
*/
class ExtensionTypeExtensionMethod extends ExtensionMethodImpl {
ExtensionTypeExtensionMethod() { this.isInExtension() }
}
/**
@@ -536,6 +556,21 @@ class RecordCloneMethod extends Method {
}
}
/**
* An extension operator, for example `*` in
*
* ```csharp
* static class MyExtensions {
* extension(string s) {
* public static string operator *(int s1, string s2) { ... }
* }
* }
* ```
*/
class ExtensionOperator extends ExtensionCallableImpl, Operator {
ExtensionOperator() { this.isInExtension() }
}
/**
* A user-defined unary operator - an operator taking one operand.
*

View File

@@ -102,6 +102,9 @@ class Declaration extends NamedElement, @declaration {
* implicit constructors or accessors.
*/
predicate isCompilerGenerated() { compiler_generated(this) }
/** Holds if this declaration is in an extension type. */
predicate isInExtension() { this.getDeclaringType() instanceof ExtensionType }
}
/** A declaration that can have a modifier. */
@@ -469,7 +472,7 @@ class Virtualizable extends Overridable, Member, @virtualizable {
/**
* A parameterizable declaration. Either a callable (`Callable`), a delegate
* type (`DelegateType`), or an indexer (`Indexer`).
* type (`DelegateType`), an indexer (`Indexer`), or an extension (`ExtensionType`).
*/
class Parameterizable extends Declaration, @parameterizable {
/** Gets raw parameter `i`, including the `this` parameter at index 0. */

View File

@@ -6,6 +6,7 @@ import Member
import Stmt
import Type
private import semmle.code.csharp.ExprOrStmtParent
private import semmle.code.csharp.internal.Callable
private import TypeRef
/**
@@ -260,6 +261,21 @@ class Property extends DeclarationWithGetSetAccessors, @property {
override string getAPrimaryQlClass() { result = "Property" }
}
/**
* An extension property, for example `FirstChar` in
*
* ```csharp
* static class MyExtensions {
* extension(string s) {
* public char FirstChar { get { ... } }
* }
* }
* ```
*/
class ExtensionProperty extends Property {
ExtensionProperty() { this.isInExtension() }
}
/**
* An indexer, for example `string this[int i]` on line 2 in
*
@@ -413,6 +429,22 @@ class Accessor extends Callable, Modifiable, Attributable, Overridable, @callabl
override string toString() { result = this.getName() }
}
/**
* An extension accessor. Either a getter (`Getter`) or a setter (`Setter`) of an
* extension property, for example `get` in
*
* ```csharp
* static class MyExtensions {
* extension(string s) {
* public char FirstChar { get { ... } }
* }
* }
* ```
*/
class ExtensionAccessor extends ExtensionCallableImpl, Accessor {
ExtensionAccessor() { this.isInExtension() }
}
/**
* A `get` accessor, for example `get { return p; }` in
*

View File

@@ -17,7 +17,8 @@ private import semmle.code.csharp.frameworks.system.runtime.CompilerServices
*
* Either a value or reference type (`ValueOrRefType`), the `void` type (`VoidType`),
* a pointer type (`PointerType`), the arglist type (`ArglistType`), an unknown
* type (`UnknownType`), or a type parameter (`TypeParameter`).
* type (`UnknownType`), a type parameter (`TypeParameter`) or
* an extension type (`ExtensionType`).
*/
class Type extends Member, TypeContainer, @type {
/** Gets the name of this type without additional syntax such as `[]` or `*`. */
@@ -1326,3 +1327,35 @@ class TypeMention extends @type_mention {
/** Gets the location of this type mention. */
Location getLocation() { type_mention_location(this, result) }
}
/**
* A type extension declaration, for example `extension(string s) { ... }` in
*
* ```csharp
* static class MyExtensions {
* extension(string s) { ... }
* ```
*/
class ExtensionType extends Parameterizable, @extension_type {
/**
* Gets the receiver parameter of this extension type, if any.
*/
Parameter getReceiverParameter() { result = this.getParameter(0) }
/**
* Holds if this extension type has a receiver parameter.
*/
predicate hasReceiverParameter() { exists(this.getReceiverParameter()) }
/**
* Gets the type being extended by this extension type.
*/
Type getExtendedType() {
extension_receiver_type(this, result)
or
not extension_receiver_type(this, any(Type t)) and
extension_receiver_type(this, getTypeRef(result))
}
override string getAPrimaryQlClass() { result = "ExtensionType" }
}

View File

@@ -67,6 +67,12 @@ module QualifiedName<QualifiedNameInputSig Input> {
)
}
private string getName(ValueOrRefType t) {
not t instanceof ExtensionType and result = t.getUndecoratedName()
or
result = "extension(" + getFullName(t.(ExtensionType).getExtendedType()) + ")"
}
/** Holds if declaration `d` has the qualified name `qualifier`.`name`. */
predicate hasQualifiedName(Declaration d, string qualifier, string name) {
d =
@@ -86,12 +92,12 @@ module QualifiedName<QualifiedNameInputSig Input> {
exists(string name0 | name = name0 + Input::getUnboundGenericSuffix(ugt) |
exists(string enclosing |
hasQualifiedName(ugt.getDeclaringType(), qualifier, enclosing) and
name0 = enclosing + "+" + ugt.getUndecoratedName()
name0 = enclosing + "+" + getName(ugt)
)
or
not exists(ugt.getDeclaringType()) and
qualifier = ugt.getNamespace().getFullName() and
name0 = ugt.getUndecoratedName()
name0 = getName(ugt)
)
)
or
@@ -100,12 +106,12 @@ module QualifiedName<QualifiedNameInputSig Input> {
exists(string name0 | name = name0 + "<" + getTypeArgumentsQualifiedNames(ct) + ">" |
exists(string enclosing |
hasQualifiedName(ct.getDeclaringType(), qualifier, enclosing) and
name0 = enclosing + "+" + ct.getUndecoratedName()
name0 = enclosing + "+" + getName(ct)
)
or
not exists(ct.getDeclaringType()) and
qualifier = ct.getNamespace().getFullName() and
name0 = ct.getUndecoratedName()
name0 = getName(ct)
)
)
or
@@ -116,12 +122,12 @@ module QualifiedName<QualifiedNameInputSig Input> {
(
exists(string enclosing |
hasQualifiedName(vort.getDeclaringType(), qualifier, enclosing) and
name = enclosing + "+" + vort.getUndecoratedName()
name = enclosing + "+" + getName(vort)
)
or
not exists(vort.getDeclaringType()) and
qualifier = vort.getNamespace().getFullName() and
name = vort.getUndecoratedName()
name = getName(vort)
)
)
or

View File

@@ -214,7 +214,7 @@ module ModelValidation {
not namespace.regexpMatch("[a-zA-Z0-9_\\.]+") and
result = "Dubious namespace \"" + namespace + "\" in " + pred + " model."
or
not type.regexpMatch("[a-zA-Z0-9_<>,\\+]+") and
not type.regexpMatch("[a-zA-Z0-9_<>,\\(\\)\\+\\.]+") and
result = "Dubious type \"" + type + "\" in " + pred + " model."
or
not name.regexpMatch("[a-zA-Z0-9_<>,\\.]*") and

View File

@@ -87,7 +87,8 @@ private module Internal {
newtype TDispatchCall =
TDispatchMethodCall(MethodCall mc) {
not isReflectionCall(mc, _, _, _, _) and
not mc.isLateBound()
not mc.isLateBound() and
not isExtensionAccessorCall(mc)
} or
TDispatchAccessorCall(AccessorCall ac) or
TDispatchOperatorCall(OperatorCall oc) { not oc.isLateBound() } or
@@ -110,7 +111,8 @@ private module Internal {
c instanceof ConstructorInitializer
or
c instanceof LocalFunctionCall
}
} or
TDispatchExtensionAccessorCall(MethodCall mc) { isExtensionAccessorCall(mc) }
cached
Expr getCall(DispatchCall dc) { result = dc.(DispatchCallImpl).getCall() }
@@ -142,6 +144,8 @@ private module Internal {
import Cached
private predicate isExtensionAccessorCall(MethodCall mc) { exists(mc.getTargetAccessor()) }
/**
* Holds if `mc` is a reflection call to a method named `name`, where
* `object` is the object on which to invoke the method (`null` if a
@@ -819,6 +823,33 @@ private module Internal {
override Method getAStaticTarget() { result = this.getCall().getTarget() }
}
/**
* A call to an extension accessor method.
*/
private class DispatchExtensionAccessorCall extends DispatchCallImpl,
TDispatchExtensionAccessorCall
{
override MethodCall getCall() { this = TDispatchExtensionAccessorCall(result) }
private Expr getArgumentForParameter(Parameter p) {
this.getCall().getTargetAccessor().getAParameter() = p and
result = this.getCall().getArgument(p.getPosition())
}
override Expr getArgument(int i) {
exists(MethodCall call, Parameter p | call = this.getCall() |
p = call.getTargetAccessor().getParameter(i) and
result = this.getArgumentForParameter(p)
)
}
override Expr getQualifier() { result = this.getCall().getQualifier() }
override Accessor getAStaticTarget() { result = this.getCall().getTargetAccessor() }
override RuntimeCallable getADynamicTarget() { result = this.getAStaticTarget() }
}
/**
* An ordinary operator call.
*

View File

@@ -223,6 +223,40 @@ class ParameterAccess extends LocalScopeVariableAccess, @parameter_access_expr {
override string getAPrimaryQlClass() { result = "ParameterAccess" }
}
/**
* An access to a synthetic parameter for an extension method, for example the
* access to `s` on line 3 in
*
* ```csharp
* static class MyExtensions {
* extension(string s) {
* public bool IsEmpty() { return s == string.Empty; }
* }
* }
* ```
*/
class SyntheticExtensionParameterAccess extends ParameterAccess {
SyntheticExtensionParameterAccess() {
exists(ExtensionType et, Parameter p |
p = et.getReceiverParameter() and
expr_access(this, p)
)
}
override Parameter getTarget() {
exists(ExtensionCallable c |
this.getEnclosingCallable+() = c and
result = c.getParameter(0)
)
}
override string toString() {
result = "access to extension synthetic parameter " + this.getTarget().getName()
}
override string getAPrimaryQlClass() { result = "SyntheticExtensionParameterAccess" }
}
/**
* An access to a parameter that reads the underlying value, for example
* the access to `p` on line 2 in

View File

@@ -267,9 +267,33 @@ class Call extends Expr, @call {
class MethodCall extends Call, QualifiableExpr, LateBindableExpr, @method_invocation_expr {
override Method getTarget() { expr_call(this, result) }
/**
* Gets the accessor that was used to generate this method, if any. For example, the
* method call `MyExtensions.get_FirstChar(s)` on line 9 is generated from the property
* accessor `get_FirstChar` on line 3 in
*
* ```csharp
* static class MyExtensions {
* extension(string s) {
* public char FirstChar { get { ... } }
* }
* }
*
* class A {
* char M(string s) {
* return MyExtensions.get_FirstChar(s);
* }
* }
*/
Accessor getTargetAccessor() { expr_call(this, result) }
override Method getQualifiedDeclaration() { result = this.getTarget() }
override string toString() { result = "call to method " + concat(this.getTarget().getName()) }
override string toString() {
if exists(this.getTargetAccessor())
then result = "call to extension accessor " + concat(this.getTargetAccessor().getName())
else result = "call to method " + concat(this.getTarget().getName())
}
override string getAPrimaryQlClass() { result = "MethodCall" }
@@ -479,6 +503,30 @@ class OperatorCall extends Call, LateBindableExpr, @operator_invocation_expr {
override string getAPrimaryQlClass() { result = "OperatorCall" }
}
/**
* A call to an extension operator, for example `3 * s` on
* line 9 in
*
* ```csharp
* static class MyExtensions {
* extension(string s) {
* public static string operator *(int i, string s) { ... }
* }
* }
*
* class A {
* string M(string s) {
* return 3 * s;
* }
* }
* ```
*/
class ExtensionOperatorCall extends OperatorCall {
ExtensionOperatorCall() { this.getTarget() instanceof ExtensionOperator }
override string getAPrimaryQlClass() { result = "ExtensionOperatorCall" }
}
/**
* A call to a user-defined mutator operator, for example `a++` on
* line 7 in
@@ -658,6 +706,44 @@ class IndexerCall extends AccessorCall, IndexerAccessExpr {
override string getAPrimaryQlClass() { result = "IndexerCall" }
}
/**
* A call to an extension property accessor (via the property), for example
* `s.FirstChar` on line 9 in
*
* ```csharp
* static class MyExtensions {
* extension(string s) {
* public char FirstChar { get { ... } }
* }
* }
*
* class A {
* char M(string s) {
* return s.FirstChar;
* }
* }
* ```
*/
class ExtensionPropertyCall extends PropertyCall {
private ExtensionProperty prop;
ExtensionPropertyCall() { this.getProperty() = prop }
override Expr getArgument(int i) {
if prop.isStatic()
then result = super.getArgument(i)
else (
// Shift arguments as the qualifier is an explicit argument in the getter/setter.
i = 0 and
result = this.getQualifier()
or
result = super.getArgument(i - 1)
)
}
override string getAPrimaryQlClass() { result = "ExtensionPropertyCall" }
}
/**
* A call to an event accessor, for example the call to `add_Click`
* (defined on line 5) on line 12 in

View File

@@ -0,0 +1,33 @@
/**
* INTERNAL: Do not use.
*
* Provides `Callable` classes, which are things that can be called
* such as methods and operators.
*/
private import semmle.code.csharp.Callable
private import semmle.code.csharp.Property
/**
* A callable that is declared as an extension.
*
* Either an extension method (`ExtensionMethod`), an extension operator
* (`ExtensionOperator`) or an extension accessor (`ExtensionAccessor`).
*/
abstract class ExtensionCallableImpl extends Callable {
/** Gets the type being extended by this method. */
pragma[noinline]
Type getExtendedType() { result = this.getDeclaringType().(ExtensionType).getExtendedType() }
override string getAPrimaryQlClass() { result = "ExtensionCallable" }
}
/**
* An extension method.
*
* Either a classic extension method (`ClassicExtensionMethod`) or an extension
* type extension method (`ExtensionTypeExtensionMethod`).
*/
abstract class ExtensionMethodImpl extends ExtensionCallableImpl, Method {
override string getAPrimaryQlClass() { result = "ExtensionMethod" }
}

View File

@@ -492,6 +492,7 @@ case @type.kind of
| 32 = @tuple_type
| 33 = @function_pointer_type
| 34 = @inline_array_type
| 35 = @extension_type
;
@simple_type = @bool_type | @char_type | @integral_type | @floating_point_type | @decimal_type;
@@ -502,7 +503,7 @@ case @type.kind of
@value_type = @simple_type | @enum_type | @struct_type | @nullable_type | @int_ptr_type
| @uint_ptr_type | @tuple_type | @void_type | @inline_array_type;
@ref_type = @class_type | @interface_type | @array_type | @delegate_type | @null_type
| @dynamic_type;
| @dynamic_type | @extension_type;
@value_or_ref_type = @value_type | @ref_type;
typerefs(
@@ -541,6 +542,10 @@ function_pointer_return_type(
unique int function_pointer_id: @function_pointer_type ref,
int return_type_id: @type_or_ref ref);
extension_receiver_type(
unique int extension: @extension_type ref,
int receiver_type_id: @type_or_ref ref);
extend(
int sub: @type ref,
int super: @type_or_ref ref);
@@ -903,7 +908,7 @@ localvar_location(
unique int id: @local_variable ref,
int loc: @location ref);
@parameterizable = @callable | @delegate_type | @indexer | @function_pointer_type;
@parameterizable = @callable | @delegate_type | @indexer | @function_pointer_type | @extension_type;
#keyset[name, parent_id]
#keyset[index, parent_id]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Add the relation `extension_receiver_type` and add the `extension_type` type kind.
compatibility: full

View File

@@ -1,3 +1,9 @@
## 1.6.2
### Bug Fixes
* The `cs/web/missing-token-validation` ("Missing cross-site request forgery token validation") query now recognizes antiforgery attributes on base controller classes, fixing false positives when `[ValidateAntiForgeryToken]` or `[AutoValidateAntiforgeryToken]` is applied to a parent class.
## 1.6.1
No user-facing changes.

View File

@@ -54,12 +54,12 @@ predicate hasGlobalAntiForgeryFilter() {
predicate isUnvalidatedPostMethod(Class c, Method m) {
c.(Controller).getAPostActionMethod() = m and
not m.getAnAttribute() instanceof ValidateAntiForgeryTokenAttribute and
not c.getAnAttribute() instanceof ValidateAntiForgeryTokenAttribute
not c.getABaseType*().getAnAttribute() instanceof ValidateAntiForgeryTokenAttribute
or
c.(AspNetCore::MicrosoftAspNetCoreMvcController).getAnActionMethod() = m and
m.getAnAttribute() instanceof AspNetCore::MicrosoftAspNetCoreMvcHttpPostAttribute and
not m.getAnAttribute() instanceof AspNetCore::ValidateAntiForgeryAttribute and
not c.getAnAttribute() instanceof AspNetCore::ValidateAntiForgeryAttribute
not c.getABaseType*().getAnAttribute() instanceof AspNetCore::ValidateAntiForgeryAttribute
}
Element getAValidatedElement() {

View File

@@ -0,0 +1,5 @@
## 1.6.2
### Bug Fixes
* The `cs/web/missing-token-validation` ("Missing cross-site request forgery token validation") query now recognizes antiforgery attributes on base controller classes, fixing false positives when `[ValidateAntiForgeryToken]` or `[AutoValidateAntiforgeryToken]` is applied to a parent class.

View File

@@ -1,2 +1,2 @@
---
lastReleaseVersion: 1.6.1
lastReleaseVersion: 1.6.2

View File

@@ -1,5 +1,5 @@
name: codeql/csharp-queries
version: 1.6.1
version: 1.6.2
groups:
- csharp
- queries

Some files were not shown because too many files have changed in this diff Show More