staging/lustre/lnetselftest: Fix potential integer overflow
authorOleg Drokin <green@linuxhacker.ru>
Wed, 7 Dec 2016 05:39:27 +0000 (00:39 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Dec 2016 15:29:10 +0000 (16:29 +0100)
commit4f43d8dbe634cc79c4b45cc088d066768c0359d2
treee53c87253b4ba20ae0ee323da7a2d5e3fbe009ef
parent3282998c8010f6eb42950d628f4df980da528b75
staging/lustre/lnetselftest: Fix potential integer overflow

It looks like if the passed in parameter is not present, but
parameter length is non zero, then sanity checks on the length
are skipped and lstcon_test_add() might then use incorrect
allocation that's prone to integer overflow size.

This patch ensures that parameter len is zero if parameter is
not present.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lnet/selftest/conctl.c