Add check_assigned_expr.c
commitfbd0093e768caff2a995b245454caed6b52c62a7
authorDan Carpenter <error27@gmail.com>
Mon, 3 Aug 2009 18:39:02 +0000 (3 20:39 +0200)
committerDan Carpenter <error27@gmail.com>
Mon, 3 Aug 2009 18:39:02 +0000 (3 20:39 +0200)
treefc19dd9943c7058a8c1fc65fb4aeaeb9de6abe66
parenteaec8b857b12aebb5b2c9542366a264a7cff6bc4
Add check_assigned_expr.c

This isn't a check by itself, it's just a tool.

When I was looking for buffer overflows I wondered what allocation
functions people were using to allocate pointers used as arrays.
Code like this:
int *foo;
foo = some_allocation_func();
foo[x] = 1;
I wrote a script to print out the "= some_allocation_func()" after it
saw "foo[x]".  This script is useful for that.

I thought about disabling it by default but decided to enable it, so
it's easy to use later.

Signed-off-by: Dan Carpenter <error27@gmail.com>
check_assigned_expr.c [new file with mode: 0644]
smatch.c