Commit Graph

3 Commits

Author SHA1 Message Date
Anna Zaks f0267f5c9e Turn on strncat-size warning implemented a while ago.
Warns on anti-patterns/typos in the 'size' argument to strncat. The
correct size argument should look like the following:
 - strncat(dst, src, sizeof(dst) - strlen(dest) - 1);

We warn on: 
 - sizeof(dst)
 - sizeof(src)
 - sizeof(dst) - strlen(dst)
 - sizeof(src) - anything

(This has been implemented in void Sema::CheckStrncatArguments().)

llvm-svn: 161440
2012-08-07 18:36:58 +00:00
Anna Zaks 0cdce4df76 [analyzer] Turn on by default the Malloc Checker and a couple of CString
checks:

- unix.Malloc - Checks for memory leaks, double free, use-after-free.
- unix.cstring.NullArg - Checks for null pointers passed as arguments to
CString functions + evaluates CString functions.
- unix.cstring.BadSizeArg - Checks for common anti-patterns in
strncat size argument.

llvm-svn: 150988
2012-02-20 21:10:37 +00:00
Anna Zaks 87b6ff09f9 [analyzer] Add checks for common anti-patterns in strncat.
(Since this is syntax only, might be a good candidate for turning into a
compiler warning.)

llvm-svn: 149407
2012-01-31 19:33:39 +00:00