buf_size: strcpy() only sets the size of the destination at the end
commite0dc71ed75e12c801df8eb3571fb68dcd576eee7
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Jun 2012 11:19:18 +0000 (13 14:19 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 13 Jun 2012 11:19:18 +0000 (13 14:19 +0300)
treec55c69884ed43a6fad639fe7f4d39f30761ccdd4
parent417cfd3bf09b3c4da4b882699e18423a969e0e73
buf_size: strcpy() only sets the size of the destination at the end

The problem here is that there are several different ways we calculate the
size of a buffer.  We can look at how it was declared or how maybe we have
it saved as a state.  I moved from preferring how it was declared to using
the state, and it broke the strcpy() checks.  The problem is that we save
the size from strcpy() before check_overflow.c has a chance to see if the
data is larger than the destination.

Really we shouldn't be setting that until after the tests have had a chance
to get the original buffer size.

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