1 | ---
|
---|
2 | - description: C++ queries
|
---|
3 |
|
---|
4 | - queries: '.'
|
---|
5 | from: codeql/[email protected]
|
---|
6 |
|
---|
7 | ##########################################################################################
|
---|
8 | # Queries
|
---|
9 | ##########################################################################################
|
---|
10 |
|
---|
11 | ## Errors
|
---|
12 | - include:
|
---|
13 | id: cpp/badoverflowguard
|
---|
14 | - include:
|
---|
15 | id: cpp/infiniteloop
|
---|
16 | - include:
|
---|
17 | id: cpp/likely-bugs/memory-management/v2/conditionally-uninitialized-variable
|
---|
18 | - include:
|
---|
19 | id: cpp/missing-null-test
|
---|
20 | - include:
|
---|
21 | id: cpp/missing-return
|
---|
22 | - include:
|
---|
23 | id: cpp/no-space-for-terminator
|
---|
24 | - include:
|
---|
25 | id: cpp/pointer-overflow-check
|
---|
26 | - include:
|
---|
27 | id: cpp/redundant-null-check-simple
|
---|
28 | - include:
|
---|
29 | id: cpp/sizeof/const-int-argument
|
---|
30 | - include:
|
---|
31 | id: cpp/sizeof/sizeof-or-operation-as-argument
|
---|
32 | - include:
|
---|
33 | id: cpp/unguardednullreturndereferenc
|
---|
34 | - include:
|
---|
35 | id: cpp/very-likely-overrunning-write
|
---|
36 |
|
---|
37 | ## Warnings
|
---|
38 | - include:
|
---|
39 | id: cpp/comparison-with-wider-type
|
---|
40 | - include:
|
---|
41 | id: cpp/conditionallyuninitializedvariable
|
---|
42 | - include:
|
---|
43 | id: cpp/comparison-precedence
|
---|
44 | - include:
|
---|
45 | id: cpp/implicit-bitfield-downcast
|
---|
46 | - include:
|
---|
47 | id: cpp/infinite-loop-with-unsatisfiable-exit-condition
|
---|
48 | - include:
|
---|
49 | id: cpp/offset-use-before-range-check
|
---|
50 | - include:
|
---|
51 | id: cpp/overflow-buffer
|
---|
52 | - include:
|
---|
53 | id: cpp/overflow-calculated
|
---|
54 | - include:
|
---|
55 | id: cpp/overflow-destination
|
---|
56 | - include:
|
---|
57 | id: cpp/paddingbyteinformationdisclosure
|
---|
58 | - include:
|
---|
59 | id: cpp/return-stack-allocated-memory
|
---|
60 | - include:
|
---|
61 | id: cpp/static-buffer-overflow
|
---|
62 | - include:
|
---|
63 | id: cpp/unsigned-comparison-zero
|
---|
64 | - include:
|
---|
65 | id: cpp/uselesstest
|
---|
66 |
|
---|
67 | ## Recommendations
|
---|
68 | - include:
|
---|
69 | id: cpp/missing-header-guard
|
---|
70 | - include:
|
---|
71 | id: cpp/unused-local-variable
|
---|
72 | - include:
|
---|
73 | id: cpp/unused-static-variable
|
---|
74 |
|
---|
75 | # Note: Some queries above are not active by default with the below filter.
|
---|
76 | # Update the filter and run the queries again to get all results.
|
---|
77 | - include:
|
---|
78 | tags:
|
---|
79 | - "security"
|
---|
80 | - "correctness"
|
---|
81 | severity:
|
---|
82 | - "error"
|
---|
83 | - "warning"
|
---|
84 | - "recommendation"
|
---|
85 |
|
---|
86 | # Specifically hide the results of these.
|
---|
87 | #
|
---|
88 | # The following rules have been evaluated and explicitly not included for the following reasons:
|
---|
89 | # - `cpp/allocation-too-small` - Appears to be hardcoded for C standard library functions `malloc`, `calloc`,
|
---|
90 | # `realloc`, so it consumes time without much value with custom allocation functions in the codebase.
|
---|
91 | # - `cpp/commented-out-code` - Triggers often. Needs further review.
|
---|
92 | # - `cpp/duplicate-include-guard` - The <Phase>EntryPoint.h files includes a common include guard value
|
---|
93 | # `__MODULE_ENTRY_POINT_H__`. This was the only occurrence found. So not very useful.
|
---|
94 | # - `cpp/invalid-pointer-deref` - Very limited results with what appear to be false positives.
|
---|
95 | # - `cpp/use-of-goto` - Goto is valid and allowed in the codebase.
|
---|
96 | # - `cpp/useless-expression` - Triggers too often on cases where a NULL lib implementation is provided for a function.
|
---|
97 | # Because the implementation simply returns, the check considers it useless.
|
---|
98 | # - `cpp/weak-crypto/*` - Crypto algorithms are tracked outside CodeQL.
|
---|
99 | - exclude:
|
---|
100 | id: cpp/allocation-too-small
|
---|
101 | - exclude:
|
---|
102 | id: cpp/commented-out-code
|
---|
103 | - exclude:
|
---|
104 | id: cpp/duplicate-include-guard
|
---|
105 | - exclude:
|
---|
106 | id: cpp/invalid-pointer-deref
|
---|
107 | - exclude:
|
---|
108 | id: cpp/use-of-goto
|
---|
109 | - exclude:
|
---|
110 | id: cpp/useless-expression
|
---|
111 | - exclude:
|
---|
112 | id: cpp/weak-crypto/banned-hash-algorithms
|
---|
113 | - exclude:
|
---|
114 | id: cpp/weak-crypto/capi/banned-modes
|
---|
115 | - exclude:
|
---|
116 | id: cpp/weak-crypto/openssl/banned-hash-algorithms
|
---|