The Hook
Nothing erodes developer trust in a SAST pipeline faster than a single line of C code triggering two separate buffer-overflow rules simultaneously—one for POSIX strcat and a second false match claiming the code called Microsoft's Win32 StrCat API.
The Deep Dive
GitLab's static analysis engine relies on curated Semgrep rule packs maintained in gitlab-org/security-products/sast-rules to detect memory-safety flaws (such as CWE-120 buffer copies without checking size of input) across C and C++ codebases. To provide accurate remediation guidance across operating systems, the rule repository separates standard C library string concatenation ( c/buffer/rule-strcat.yml , targeting lowercase strcat(...) ) from Windows Shell/ATL string manipulation APIs ( c/buffer/rule-StrCat-StrCatA.yml , targeting StrCat , StrCatA , and StrCatW ).
While auditing duplicate C buffer findings and authoring MR !747 ( fix: correct StrCat rule case sensitivity ) in sast-rules , I examined why standard POSIX C files calling…