llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Ruhin575

<details>
<summary>Changes</summary>

Extended the security.insecureAPI.strcpy checker to detect six more unsafe 
string functions: lstrcpyA, lstrcatA, lstrcpyW, lstrcatW, wcscpy, and wcscat.
Partial fix for #<!-- -->103038.
Changes
• Added the six functions to the existing checker.
• Updated type checking to support both char* and wchar_t*, including typedefs.
• Updated warning messages to show the actual function name.
• Changed the safe-copy check to compare array element counts instead of bytes.
• Added tests for all six functions, including safe and unsafe wide-character 
copies.
Testing
• Built Clang successfully using ninja -C build clang.
• Ran security-syntax-checks.m using LLVM lit. All 4 test configurations passed.
• Tested warnings for all six newly added functions.
• Tested safe and unsafe string copies, including wide-character buffers of 
different sizes.
• Checked formatting using git-clang-format and whitespace using git diff 
--check.

---
Full diff: https://github.com/llvm/llvm-project/pull/234582.diff


2 Files Affected:

- (modified) clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp 
(+104-30) 
- (modified) clang/test/Analysis/security-syntax-checks.m (+60) 


``````````diff
The server is unavailable at this time. Please wait a few minutes before you 
try again.
``````````

</details>


https://github.com/llvm/llvm-project/pull/234582
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to