Skip to content

Commit

Permalink
brave-missing-break-in-switch.yaml: add NOTREACHED_IN_MIGRATION case
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Jun 24, 2024
1 parent 2c46b1d commit fba0490
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rules:
- https://github.com/struct/mms
- https://github.com/returntocorp/semgrep/issues/4939
confidence: MEDIUM
source: https://github.com/brave/security-action/blob/main/assets/semgrep_rules/client/missing-break-in-switch.yaml
source: https://github.com/brave/security-action/blob/main/assets/semgrep_rules/client/brave-missing-break-in-switch.yaml
# NOTE: we should also check for default blocks that miss the
# break/return/exit or equivalent statement/function call.
message: >-
Expand Down Expand Up @@ -50,5 +50,10 @@ rules:
switch ($VAR) { case $VAL1: NOTREACHED_NORETURN(); case $VAL2: ... }
- pattern-not: |
switch ($VAR) { case $VAL1: ... NOTREACHED_NORETURN(); case $VAL2: ... }
# NOTREACHED_IN_MIGRATION
- pattern-not: |
switch ($VAR) { case $VAL1: NOTREACHED_IN_MIGRATION(); case $VAL2: ... }
- pattern-not: |
switch ($VAR) { case $VAL1: ... NOTREACHED_IN_MIGRATION(); case $VAL2: ... }
# [[fallthrough]];
- pattern-not-regex: '\[\[fallthrough\]\];'

0 comments on commit fba0490

Please sign in to comment.