*new* check_string_len.c: look for sprintf() overflows
commit1fc8b1e237fb151313a447faa8f26984134da3cc
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 31 Jan 2013 14:14:50 +0000 (31 17:14 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 31 Jan 2013 14:14:50 +0000 (31 17:14 +0300)
treed130210554e43102926924886d39baf69bffbe33
parent9c2faa599bd066d2a08cc00af8b7de4b5aa63e16
*new* check_string_len.c: look for sprintf() overflows

This looks for places where sprintf() could lead to an overflow.

This generates about 200 warnings.

There are quite a few false positives.  There were a few serious bugs which
needed to be fixed.  And then there are a bunch of cases where root could
cause an overflow or which I consider sloppy but not worth fixing.

I considered disabling this unless --spammy was used but then I decided
that long term I want to encourage people to use snprintf() anyway.

This check often assumes that INT_MIN is possible, because Smatch is a bit
limited.  It might be a good idea to turn that off.  We'll see.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_string_len.c [new file with mode: 0644]