buf_size: ignore unknown array sizes better
commit80165c27ccb22409aafb3c62143e4ce95839562e
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 11 Dec 2013 11:55:37 +0000 (11 14:55 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 11 Dec 2013 11:55:37 +0000 (11 14:55 +0300)
treeade6ee3bc3b65e2e943b13cf7a55e77662fda337
parent5a77ceb15af816481a5a29da164cdc8b06dc96ca
buf_size: ignore unknown array sizes better

The original code almost works, unknown sizes are supposed to be set to
-1, but actually you can have places like:

if (x > 100)
return;
foo = malloc(x);

It records the size of foo as s32min-100 instead of (-1)-100.  Fix this by
ignoring all negatives.

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