[clang] [analyzer] CStringChecker: fix crash in `CheckOverlap` when arguments are not pointers (PR #160511)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 25 12:53:54 PDT 2025


guillem-bartrina-sonarsource wrote:

Thanks @NagyDonat for the suggestions! I've applied both of them in 7b31427. I took the liberty of separating the test case into another file because it didn't fit well in the previous one, which had several `// RUN` commands for different flavors of the `sprintf` functions

> Now that CheckOverlap does this verification, are there any call sites where the verification logic is made completely redundant by your change?

There are no call sites that verify all assumptions. Only https://github.com/llvm/llvm-project/blob/main/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp#L2725-L2737 verified some of them, and that was incidental. In short: no, there is no redundant verification logic. 

I also added a more esoteric test case, as suggested by @steakhal in aabc2f7. LMKWYT.

https://github.com/llvm/llvm-project/pull/160511


More information about the cfe-commits mailing list