Skip to content

Commit

Permalink
Merge branch 'main' into rp/fix-824
Browse files Browse the repository at this point in the history
  • Loading branch information
rak3-sh authored Dec 18, 2024
2 parents 3342bb5 + 89bd9b4 commit 6a0da2b
Show file tree
Hide file tree
Showing 350 changed files with 3,713 additions and 781 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/code-scanning-pack-gen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,17 @@ jobs:
- name: Determine ref for external help files
id: determine-ref
run: |
if [[ $GITHUB_EVENT_NAME == "pull_request" || $GITHUB_EVENT_NAME == "merge_group" ]]; then
echo "EXTERNAL_HELP_REF=$GITHUB_HEAD_REF" >> "$GITHUB_ENV"
if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then
EXTERNAL_HELP_REF="${{ github.event.pull_request.base.ref }}"
elif [[ $GITHUB_EVENT_NAME == "merge_group" ]]; then
EXTERNAL_HELP_REF="${{ github.event.merge_group.base_ref }}"
else
echo "EXTERNAL_HELP_REF=$GITHUB_REF" >> "$GITHUB_ENV"
EXTERNAL_HELP_REF="$GITHUB_REF"
fi
echo "EXTERNAL_HELP_REF=$EXTERNAL_HELP_REF" >> "$GITHUB_ENV"
echo "Using ref $EXTERNAL_HELP_REF for external help files."
- name: Checkout external help files
continue-on-error: true
id: checkout-external-help-files
uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ jobs:
steps:
- name: Check if run-test-suites job failed to complete, if so fail
if: ${{ needs.run-test-suites.result == 'failure' }}
uses: actions/github-script@v3
uses: actions/github-script@v7
with:
script: |
core.setFailed('Test run job failed')
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dispatch-matrix-test-on-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
--json \
-R github/codeql-coding-standards-release-engineering
- uses: actions/github-script@v6
- uses: actions/github-script@v7
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-matrix') && steps.check-write-permission.outputs.has-permission }}
with:
script: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dispatch-release-performance-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
--json \
-R github/codeql-coding-standards-release-engineering
- uses: actions/github-script@v6
- uses: actions/github-script@v7
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/test-performance') && steps.check-write-permission.outputs.has-permission }}
with:
script: |
Expand Down
2 changes: 1 addition & 1 deletion amendments.csv
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ c,MISRA-C-2012,Amendment4,RULE-11-3,Yes,Expand,No,Easy
c,MISRA-C-2012,Amendment4,RULE-11-8,Yes,Expand,No,Easy
c,MISRA-C-2012,Amendment4,RULE-13-2,Yes,Expand,No,Very Hard
c,MISRA-C-2012,Amendment4,RULE-18-6,Yes,Expand,No,Medium
c,MISRA-C-2012,Amendment4,RULE-18-8,Yes,Split,No,Easy
c,MISRA-C-2012,Amendment4,RULE-18-8,Yes,Split,Yes,Easy
c,MISRA-C-2012,Corrigendum2,RULE-2-2,Yes,Clarification,No,Import
c,MISRA-C-2012,Corrigendum2,RULE-2-7,Yes,Clarification,No,Import
c,MISRA-C-2012,Corrigendum2,RULE-3-1,Yes,Refine,No,Easy
Expand Down
20 changes: 13 additions & 7 deletions c/cert/src/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@
lockVersion: 1.0.0
dependencies:
codeql/cpp-all:
version: 0.12.9
version: 1.4.2
codeql/dataflow:
version: 0.2.3
version: 1.1.1
codeql/mad:
version: 1.0.7
codeql/rangeanalysis:
version: 0.0.11
version: 1.0.7
codeql/ssa:
version: 0.2.12
version: 1.0.7
codeql/tutorial:
version: 0.2.12
version: 1.0.7
codeql/typeflow:
version: 1.0.7
codeql/typetracking:
version: 0.2.12
version: 1.0.7
codeql/util:
version: 0.2.12
version: 1.0.7
codeql/xml:
version: 1.0.7
compiled: false
4 changes: 2 additions & 2 deletions c/cert/src/qlpack.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: codeql/cert-c-coding-standards
version: 2.38.0-dev
version: 2.40.0-dev
description: CERT C 2016
suites: codeql-suites
license: MIT
dependencies:
codeql/common-c-coding-standards: '*'
codeql/cpp-all: 0.12.9
codeql/cpp-all: 1.4.2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import cpp
import codingstandards.c.cert
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow
import NonArrayPointerToArrayIndexingExprFlow::PathGraph

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import cpp
import codingstandards.c.cert
import codingstandards.cpp.Pointers
import codingstandards.cpp.dataflow.TaintTracking
import semmle.code.cpp.dataflow.TaintTracking
import ScaledIntegerPointerArithmeticFlow::PathGraph

/**
Expand Down
4 changes: 2 additions & 2 deletions c/cert/src/rules/CON30-C/CleanUpThreadSpecificStorage.ql
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import cpp
import codingstandards.c.cert
import codingstandards.cpp.Concurrency
import codingstandards.cpp.dataflow.TaintTracking
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.TaintTracking
import semmle.code.cpp.dataflow.DataFlow

module TssCreateToTssDeleteConfig implements DataFlow::ConfigSig {
predicate isSource(DataFlow::Node node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import cpp
import codingstandards.c.cert
import codingstandards.cpp.Concurrency
import codingstandards.cpp.dataflow.TaintTracking
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.TaintTracking
import semmle.code.cpp.dataflow.DataFlow
import semmle.code.cpp.commons.Alloc

from C11ThreadCreateCall tcc, StackVariable sv, Expr arg, Expr acc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import cpp
import codingstandards.c.cert
import codingstandards.cpp.Concurrency
import codingstandards.cpp.dataflow.TaintTracking
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.TaintTracking
import semmle.code.cpp.dataflow.DataFlow

from TSSGetFunctionCall tsg, ThreadedFunction tf
where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import cpp
import codingstandards.c.cert
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow

class Source extends StackVariable {
Source() { not this instanceof Parameter }
Expand Down
2 changes: 1 addition & 1 deletion c/cert/src/rules/ERR30-C/FunctionCallBeforeErrnoCheck.ql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import cpp
import codingstandards.c.cert
import codingstandards.c.Errno
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow

/**
* A call to an `OutOfBandErrnoSettingFunction`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import cpp
import codingstandards.c.cert
import codingstandards.cpp.SideEffect
import codingstandards.cpp.dataflow.DataFlow
import codingstandards.cpp.dataflow.TaintTracking
import semmle.code.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.TaintTracking
import semmle.code.cpp.valuenumbering.GlobalValueNumbering

/** Holds if the function's return value is derived from the `AliasParamter` p. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,7 @@

import cpp
import codingstandards.c.cert

/**
* A struct or union type that contains an array type
*/
class StructOrUnionTypeWithArrayField extends Struct {
StructOrUnionTypeWithArrayField() {
this.getAField().getUnspecifiedType() instanceof ArrayType
or
// nested struct or union containing an array type
this.getAField().getUnspecifiedType().(Struct) instanceof StructOrUnionTypeWithArrayField
}
}
import codingstandards.cpp.lifetimes.CLifetimes

// Note: Undefined behavior is possible regardless of whether the accessed field from the returned
// struct is an array or a scalar (i.e. arithmetic and pointer types) member, according to the standard.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import cpp
import codingstandards.c.cert
import codingstandards.cpp.Alignment
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow
import semmle.code.cpp.rangeanalysis.SimpleRangeAnalysis
import ExprWithAlignmentToCStyleCastFlow::PathGraph

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import cpp
import codingstandards.c.cert
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow
import SuspectFunctionPointerToCallFlow::PathGraph

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import cpp
import codingstandards.c.cert
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow
import semmle.code.cpp.controlflow.Dominance
import IndirectCastFlow::PathGraph

Expand Down
2 changes: 1 addition & 1 deletion c/cert/src/rules/EXP40-C/DoNotModifyConstantObjects.ql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import cpp
import codingstandards.c.cert
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow
import CastFlow::PathGraph
import codingstandards.cpp.SideEffect

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

import cpp
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow
import semmle.code.cpp.controlflow.Dominance
import codingstandards.c.cert
import codingstandards.cpp.Variable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import cpp
import codingstandards.c.cert
import codingstandards.cpp.FgetsErrorManagement
import codingstandards.cpp.Dereferenced
import codingstandards.cpp.dataflow.TaintTracking
import semmle.code.cpp.dataflow.TaintTracking

/*
* CFG nodes that follows a successful call to `fgets`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import cpp
import codingstandards.c.cert
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow

class FgetposCall extends FunctionCall {
FgetposCall() { this.getTarget().hasGlobalOrStdName("fgetpos") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import cpp
import codingstandards.c.cert
import codingstandards.cpp.standardlibrary.FileAccess
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow
import semmle.code.cpp.valuenumbering.GlobalValueNumbering

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import cpp
import codingstandards.c.cert
import codingstandards.cpp.Overflow
import semmle.code.cpp.controlflow.Guards
import codingstandards.cpp.dataflow.TaintTracking
import semmle.code.cpp.dataflow.TaintTracking
import semmle.code.cpp.models.Models

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import cpp
import codingstandards.c.cert
import codingstandards.cpp.Alignment
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow
import AlignedAllocToReallocFlow::PathGraph

int getStatedValue(Expr e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import cpp
import codingstandards.c.cert
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow

/**
* The argument of a call to `asctime`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import cpp
import codingstandards.c.cert
import codingstandards.cpp.Macro
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow

abstract class VaAccess extends Expr { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import cpp
import codingstandards.c.cert
import codingstandards.c.Signal
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow

/**
* Does not access an external variable except
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import cpp
import codingstandards.c.cert
import codingstandards.c.Signal
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow

/**
* CFG nodes preceeding a `ReturnStmt`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import cpp
import codingstandards.c.cert
import semmle.code.cpp.security.BufferWrite
import codingstandards.cpp.dataflow.DataFlow
import semmle.code.cpp.dataflow.DataFlow

/**
* Class that includes into `BufferWrite` functions that will modify their
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import cpp
import codingstandards.c.cert
import codingstandards.cpp.dataflow.TaintTracking
import semmle.code.cpp.dataflow.TaintTracking
import codingstandards.cpp.PossiblyUnsafeStringOperation

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import cpp
import codingstandards.c.cert
import codingstandards.cpp.Naming
import codingstandards.cpp.dataflow.TaintTracking
import semmle.code.cpp.dataflow.TaintTracking
import codingstandards.cpp.PossiblyUnsafeStringOperation
import semmle.code.cpp.valuenumbering.GlobalValueNumbering

Expand Down
20 changes: 13 additions & 7 deletions c/cert/test/codeql-pack.lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@
lockVersion: 1.0.0
dependencies:
codeql/cpp-all:
version: 0.12.9
version: 1.4.2
codeql/dataflow:
version: 0.2.3
version: 1.1.1
codeql/mad:
version: 1.0.7
codeql/rangeanalysis:
version: 0.0.11
version: 1.0.7
codeql/ssa:
version: 0.2.12
version: 1.0.7
codeql/tutorial:
version: 0.2.12
version: 1.0.7
codeql/typeflow:
version: 1.0.7
codeql/typetracking:
version: 0.2.12
version: 1.0.7
codeql/util:
version: 0.2.12
version: 1.0.7
codeql/xml:
version: 1.0.7
compiled: false
2 changes: 1 addition & 1 deletion c/cert/test/qlpack.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: codeql/cert-c-coding-standards-tests
version: 2.38.0-dev
version: 2.40.0-dev
extractor: cpp
license: MIT
dependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
WARNING: module 'DataFlow' has been deprecated and may be removed in future (VariableLengthArraySizeNotInValidRange.ql:104,11-19)
WARNING: module 'TaintTracking' has been deprecated and may be removed in future (VariableLengthArraySizeNotInValidRange.ql:87,5-18)
| test.c:14:8:14:8 | VLA declaration | Variable-length array dimension size may be in an invalid range. |
| test.c:15:8:15:8 | VLA declaration | Variable-length array dimension size may be in an invalid range. |
| test.c:16:8:16:8 | VLA declaration | Variable-length array dimension size may be in an invalid range. |
Expand Down
Loading

0 comments on commit 6a0da2b

Please sign in to comment.