1
0
Fork 0

selftests/net: rxtimestamp: Fix an off by one

The > should be >= so that we don't write one element beyond the end of
the array.

Fixes: 16e7812241 ("selftests/net: Add a test to validate behavior of rx timestamps")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
hifive-unleashed-5.1
Dan Carpenter 2017-10-05 15:53:47 +03:00 committed by David S. Miller
parent 7a92616c0b
commit 1561b3266e
1 changed files with 1 additions and 1 deletions

View File

@ -341,7 +341,7 @@ int main(int argc, char **argv)
return 0;
case 'n':
t = atoi(optarg);
if (t > ARRAY_SIZE(test_cases))
if (t >= ARRAY_SIZE(test_cases))
error(1, 0, "Invalid test case: %d", t);
all_tests = false;
test_cases[t].enabled = true;