buf_size: turn off buf size for &addresses unless --spammy is used
commit9a368bd79e9a1627bc3d26c10f6bf5924aa34ada
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 18 Jun 2012 17:53:18 +0000 (18 20:53 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Mon, 18 Jun 2012 17:53:18 +0000 (18 20:53 +0300)
tree3e713f6e935cbca780517a445d1140402b9dffef
parent69136cd09bfb379fc7bed31165fb6db077c9a00e
buf_size: turn off buf size for &addresses unless --spammy is used

This is an ugly temporary hack.  The problem is that people do a lot of
memcpy()ing across multiple struct members so this code, while it's not
wrong, it tends to generate a lot of false positives.

The better way to fix this would be to check in the check_overflow().  Get
the member offset.  Subtract the offset from the full buffer and only warn
if the difference is still too small.  But that code is more complicated to
write.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_buf_size.c