buf_size: improve resizable struct handling
commit8e48f65b5b5e323b27a3fdcfc8b217048b76f7f6
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 29 Jun 2015 14:21:09 +0000 (29 17:21 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Mon, 29 Jun 2015 14:21:09 +0000 (29 17:21 +0300)
treef5ba2817f1fc457c423c7512b105df5e2f03bb95
parent1009459f1547d390eda7dde97c4950459e7a5b10
buf_size: improve resizable struct handling

If we have an zero size array on the end of a struct then Smatch uses the
stored size of the struct allocation to figure out the size of the array.
But if the last member of the struct is a struct with a zero size array
then we should be able to handle that as well.

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