summaryrefslogtreecommitdiffstats
path: root/lib/test_hash.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-02-08 10:18:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-09 13:10:20 +0100
commitcd47e4d69abfd5a3e85ba4ff282db5acfffd6fc2 (patch)
treeb48d3313c50fc01c8d442bbba75416a8f8070074 /lib/test_hash.c
parent57e60850e741137b37c302a4b569d33ad97631b0 (diff)
downloadlinux-cd47e4d69abfd5a3e85ba4ff282db5acfffd6fc2.tar.bz2
staging: gdm724x: fix a couple array overflows
The find_dev_index() function is frustrating. If you give it an invalid index then it returns 0. That was the intent except there is an off-by-one so it can return MAX_NIC_TYPE which is one higher than we want. There is one caller which had a sanity check to catch invalid returns, but the other two callers assumed that index was valid. My feeling is that when we are given invalid indexes, that should be treated like an error and we abandon what we were doing. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/test_hash.c')
0 files changed, 0 insertions, 0 deletions