wrong_size_arg: warn about "if (memcmp(foo, bar, sizeof(foo) != 0))"
commit7594f617fcb814a25bf4c14741dcee2c73dcea18
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 11 Feb 2015 14:02:29 +0000 (11 17:02 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 11 Feb 2015 14:02:29 +0000 (11 17:02 +0300)
treed933b3452a2cb117b85e0b9f33458b8c0e8e69af
parenta51ade8c176a945b5eb22687cc03274729ceb63a
wrong_size_arg: warn about "if (memcmp(foo, bar, sizeof(foo) != 0))"

In this example code:

if (memcmp(foo, bar, sizeof(foo) != 0))

The parenthesis are wrong so it only checks the first byte.  This test has
only found one bug in two years and no false positives.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
check_list.h
check_wrong_size_arg.c [new file with mode: 0644]