fix: correct StrCat rule case sensitivity

What does this MR do?

Fixes the case sensitivity of c_buffer_rule-StrCat-StrCatA so that it correctly matches the Windows API functions StrCat() and StrCatA() instead of lowercase strcat() and strcatA().

This prevents duplicate findings because lowercase strcat() is already detected by c_buffer_rule-strcat.

Changes:

  • Updated the Semgrep patterns to match StrCat(...) and StrCatA(...).
  • Updated positive test cases to use the correct Windows API function names.
  • Added a negative test case confirming that lowercase strcat() does not trigger c_buffer_rule-StrCat-StrCatA.
  • Added an Unreleased changelog entry.
  • Kept the existing StrcatW, lstrcatA, and lstrcatW patterns unchanged.
  • Kept the existing flawfinder mappings unchanged.

What are the relevant issue numbers?

Closes gitlab-org/gitlab#639844

Does this MR meet the acceptance criteria?

  • Test cases cover both positive and negative cases with appropriate Semgrep annotations:
    • Positive cases: // ruleid: c_buffer_rule-StrCat-StrCatA for StrCat() and StrCatA().
    • Negative case: // ok: c_buffer_rule-StrCat-StrCatA for lowercase strcat().
  • Updated patterns use the correct case-sensitive Windows API function names.
  • Existing rule metadata is preserved.
  • Existing StrcatW, lstrcatA, and lstrcatW patterns remain unchanged.
  • Flawfinder mappings remain unchanged.
  • Added a changelog entry describing the fix.
  • Targeted Semgrep tests pass: 25/25.
  • Full repository test suite passes: 547/547.
  • git diff --check passes.
  • MR is freshly rebased with main.

Merge request reports

Loading
Loading