[PATCH] D48831: alpha.unix.cstring.OutOfBounds checker enable/disable fix

Daniel Krupp via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 3 06:30:14 PDT 2018


dkrupp marked 2 inline comments as done.
dkrupp added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/CStringChecker.cpp:311
+    if (!Filter.CheckCStringOutOfBounds)
+      return StOutBound;
 
----------------
NoQ wrote:
> Could we preserve the other portion of the assertion on this branch? I.e., `assert(Filter.CheckCStringNullArg)`.
> 
> Additionally, do you really want to continue analysis on this path? Maybe `return nullptr` to sink?
I was unsure whether to return nullptr or StOutBound. I thought that alpha.unix.cstring.OutOfBounds is in alpha because it may falsely detect buffer overflows and then we would cut the path unnecessarily.  
But OK, it is safer this way.

I could not put back the assertion, because if only unix.Malloc checker is enabled (and CStringOutOfBounds and CStringNullArg are not) the assertion is not true.



https://reviews.llvm.org/D48831





More information about the cfe-commits mailing list