Skip to content

Commit

Permalink
selftests/net: rxtimestamp: Fix an off by one
Browse files Browse the repository at this point in the history
The > should be >= so that we don't write one element beyond the end of
the array.

Fixes: 16e7812 ("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>
  • Loading branch information
Dan Carpenter authored and davem330 committed Oct 6, 2017
1 parent 7a92616 commit 1561b32
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1561b32

Please sign in to comment.