overflow: add support for strlen()
commit23630093a255a07f439f7f3e7175c7e40f0b967f
authorDan Carpenter <error27@gmail.com>
Fri, 9 Jul 2010 10:41:43 +0000 (9 12:41 +0200)
committerDan Carpenter <error27@gmail.com>
Fri, 9 Jul 2010 10:41:43 +0000 (9 12:41 +0200)
treefb1baa44ee02e8658f08cae74b45f0ea962d9c75
parent865b8e80ec4b0693c54cbe6fb2baca0be3140070
overflow: add support for strlen()

This handles code like:
    foo = strlen(bar);
    if (foo < 5) {
         strcpy(buf, bar);

It doesn't handle code like:
    if (strlen(bar) < 5) {
        strcpy(buf, bar);

Thanks to Tilman Sauerbeck for the idea and the initial implementation.

Reported-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Dan Carpenter <error27@gmail.com>
check_list.h
check_overflow.c
validation/sm_strlen.c [new file with mode: 0644]