buf_comparison: store which data holds array limits in the data_info table
commit872eb632ce3a5bb31b91556845c97f9d5245fcd9
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 28 Oct 2014 07:50:39 +0000 (28 10:50 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Tue, 28 Oct 2014 07:50:39 +0000 (28 10:50 +0300)
tree874bd55b2eed1a0e4611797a01ea937205a20d3d
parentebf9daa32dc4ecceca7051be0b72a00e420bb3f0
buf_comparison: store which data holds array limits in the data_info table

Say we have have some code:

foo->bar = malloc(sizeof(*foo->bar) * foo->nr);

Then later we have some code in a different function which does:

if (x <= foo->nr)
return foo->bar[x];

Maybe we can't track all how the function is called, but we can record
that at least one time foo->bar had foo->nr elements so the test looks
off by one.

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