Commit Graph

751 Commits

Author SHA1 Message Date
Geoffrey White
a57f803b37 C++: Address false positive results. 2026-03-16 19:03:10 +00:00
Geoffrey White
6552c849f0 C++: Fix BMN issue in cpp/integer-multiplication-cast-to-long. 2026-03-11 17:49:36 +00:00
Mathias Vorreiter Pedersen
26e8701ae3 C++: Fix a few qualifiers. 2026-02-27 16:22:51 +00:00
Mathias Vorreiter Pedersen
cdb41588a9 C++: Fix some imports. 2026-02-27 16:22:49 +00:00
Mathias Vorreiter Pedersen
1dba99f47d Merge pull request #21292 from microsoft/UncheckedLeaprYearAfterModification_Refactor_Upstream
C++: Refactor of UncheckedLeapYearAfterModification
2026-02-20 12:11:45 +00:00
Ben Rodes
ea0d1bf262 Apply suggestion from @bdrodes 2026-02-17 12:38:59 -05:00
Ben Rodes
0106072b88 Update cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2026-02-17 12:35:27 -05:00
Ben Rodes
779fd757a3 Update cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2026-02-17 12:35:15 -05:00
Ben Rodes
1072d6a7b7 Apply suggestion from @geoffw0
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2026-02-17 10:49:58 -05:00
Ben Rodes
c811fae876 Update cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2026-02-17 10:14:11 -05:00
Ben Rodes
549dcb31be Update cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2026-02-17 10:13:55 -05:00
Jeroen Ketema
26a1f4888a C++: Modernize MustFlow using parameterized modules 2026-02-16 17:27:41 +01:00
REDMOND\brodes
d1811bc1fe C++: Removing unnecessary post update node. 2026-02-12 11:19:24 -05:00
REDMOND\brodes
febc82dc19 Merge branch 'UncheckedLeaprYearAfterModification_Refactor_Upstream' of https://github.com/microsoft/codeql into UncheckedLeaprYearAfterModification_Refactor_Upstream 2026-02-12 11:12:01 -05:00
REDMOND\brodes
4a7395b017 C++ Suggested code clean up. 2026-02-12 11:11:43 -05:00
Ben Rodes
9bbbbefd34 Apply suggestion from @geoffw0
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2026-02-12 10:20:59 -05:00
Ben Rodes
36e4efe77e Apply suggestion from @geoffw0
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2026-02-12 10:20:32 -05:00
Ben Rodes
f5a38b4701 Apply suggestion from @geoffw0
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2026-02-12 10:17:56 -05:00
Ben Rodes
b39732ba02 Update cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2026-02-12 10:10:11 -05:00
Ben Rodes
dfe6ed2171 Update cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2026-02-12 10:09:25 -05:00
REDMOND\brodes
c64a6762d0 Merge branch 'UncheckedLeaprYearAfterModification_Refactor_Upstream' of https://github.com/microsoft/codeql into UncheckedLeaprYearAfterModification_Refactor_Upstream 2026-02-12 09:52:49 -05:00
REDMOND\brodes
f7231f40eb C++: misc comment clean up per PR suggestions. Unified additional flow steps for two similar flows into a common additional step predicate. 2026-02-12 09:52:19 -05:00
Ben Rodes
d1eb9ab5d2 Update cpp/ql/src/Likely Bugs/Leap Year/UncheckedLeapYearAfterYearModification.ql
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2026-02-12 09:36:36 -05:00
REDMOND\brodes
e2ad1f6511 C++: Updating comment per PR reveiw suggestions. 2026-02-12 09:20:55 -05:00
REDMOND\brodes
8e36316ebf C++: Addressing Copilot PR suggestions. 2026-02-09 10:42:34 -05:00
REDMOND\brodes
ca18179bd2 C++: Correct false positive. Only TimeConversionFunction that do not auto correct for leap year should be considered. 2026-02-06 16:07:07 -05:00
REDMOND\brodes
95d4a541bc C++: Refactor leap year logic for UncheckedLeapYearAfterYearModification. Includes new logic for detecting leap year checks, new forms of leap year checks detected, and various heuristics to remove false postives. Move TimeConversionFunction into LeapYear.qll and refactored to separate conversion functions that are expected to be checked for failure from those that auto correct leap year dates if feb 29 is provided on a non-leap year. Increas the set of known TimeConversionFunctions. 2026-02-06 16:03:37 -05:00
Jeroen Ketema
5117b5906b C++: Exclude comparisons from enum constants in `cpp/constant-comparison 2026-01-06 13:53:44 +01:00
Jeroen Ketema
90d6c9fc56 C++: Exclude more comparisons from cpp/constant-comparison 2026-01-06 13:53:40 +01:00
Nora Dimitrijević
f7a1a4cf75 C++/NonConstantFormat 2025-10-28 09:41:38 +01:00
Mathias Vorreiter Pedersen
5e82eb9b24 C++: Fixup queries which assumes that a guard is always an expression. 2025-09-18 12:16:21 +01:00
Ian Lynagh
b3f4c68a1d C++: Remove the BMN filter from some queries, but reduce precision to medium
Remove the `not any(Compilation c).buildModeNone() and` clause from:
    cpp/wrong-type-format-argument
    cpp/comparison-with-wider-type
    cpp/integer-multiplication-cast-to-long
    cpp/implicit-function-declaration
    cpp/suspicious-add-sizeof
but reduce their precision to `medium`.
2025-09-11 13:32:11 +01:00
Michael Nebel
83d53baf82 C++: Fix some Ql4Ql violations. 2025-09-03 08:19:18 +02:00
Nora Dimitrijević
91b9c3e647 [DIFF-INFORMED] C++: LeapYear
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/cpp/ql/src/Likely%20Bugs/Leap%20Year/UncheckedLeapYearAfterYearModification.ql#L57
https://github.com/d10c/codeql/blob/d10c/diff-informed-phase-3/cpp/ql/src/Likely%20Bugs/Leap%20Year/Adding365DaysPerYear.ql#L21
2025-08-15 12:00:52 +02:00
Nora Dimitrijević
2f56baace2 [DIFF-INFORMED] C++: NonConstantFormat 2025-08-15 12:00:50 +02:00
Nora Dimitrijević
4dd07f475b C++: mass enable diff-informed data flow
An auto-generated patch that enables diff-informed data flow in the obvious cases.

Builds on https://github.com/github/codeql/pull/18342 and https://github.com/github/codeql-patch/pull/88
2025-06-11 18:51:01 +02:00
Jeroen Ketema
723778fa82 C++: Limit flow through sinks and sources in cpp/upcast-array-pointer-arithmetic 2025-04-30 20:31:12 +02:00
Ian Lynagh
063bff073b C++: Add checks for build mode in various queries
Adds a check for the absence of build-mode-none in
    cpp/wrong-type-format-argument
    cpp/comparison-with-wider-type
    cpp/integer-multiplication-cast-to-long
    cpp/implicit-function-declaration
    cpp/suspicious-add-sizeof
2025-04-24 12:15:31 +01:00
Jeroen Ketema
df3282c204 C++: Support C23 typeof and typeof_unqual 2025-04-23 16:56:47 +02:00
Anders Schack-Mulligen
9375e571b1 C++: Use SSA data flow integration module. 2025-03-14 10:51:24 +01:00
Calum Grant
a033ba9347 C++: Detect multiple definitions based on the format parameter index 2025-01-29 13:36:10 +00:00
Calum Grant
cc35ec49e4 C++: Remove linker-awareness FPs 2025-01-28 14:06:38 +00:00
Jeroen Ketema
06f6bac169 C++: Silence alerts coming from CMake test compilation files 2025-01-07 14:12:55 +01:00
Calum Grant
d5571c5f68 Merge pull request #18309 from github/calumgrant/bmn/return-stack-allocated-memory
C++: Fix FPs to cpp/return-stack-allocated-memory
2024-12-20 10:54:24 +00:00
Jeroen Ketema
b7d1da8741 C++: Introduce a new base class for template parameters
This will enable us to support non-type template parameters, which we
currently do not support, and error template parameters, which might
become relevant in the `build-mode: none` context.
2024-12-17 20:25:41 +01:00
Calum Grant
14cef6a207 C++: Fix FPs to cpp/return-stack-allocated-memory 2024-12-17 15:58:39 +00:00
Calum Grant
fa123a7215 Merge pull request #18200 from github/calumgrant/bmn/wrong-type-format-args2
C++: Fix more FPs with extraction errors on cpp/wrong-type-format-arguments
2024-12-06 17:50:56 +00:00
Calum Grant
2cd4e1af9f C++: Use Expr.stripType() 2024-12-06 09:55:05 +00:00
Calum Grant
28c5187a3c C++: Remove FPs in cpp/wrong-type-format-argument when string type is an error 2024-12-04 11:02:19 +00:00
Calum Grant
99efff2217 C++: Fix a FP in cpp/wrong-number-format-arguments caused by extraction error 2024-12-03 16:40:02 +00:00