Re: [PATCH][next] perf tests: fix out of bounds access on array fd when cnt is 100

2018-03-14 Thread Arnaldo Carvalho de Melo
Em Wed, Mar 14, 2018 at 05:33:54PM +, Colin King escreveu: > From: Colin Ian King > > Currently when cnt is 100 an array bounds overflow occurs on the assignment > of fd[cnt]. Fix this by performing the bounds check on cnt before writing > to fd. > > Detected by cppcheck: > tools/perf/tests/

[PATCH][next] perf tests: fix out of bounds access on array fd when cnt is 100

2018-03-14 Thread Colin King
From: Colin Ian King Currently when cnt is 100 an array bounds overflow occurs on the assignment of fd[cnt]. Fix this by performing the bounds check on cnt before writing to fd. Detected by cppcheck: tools/perf/tests/bp_account.c:115: (warning) Either the condition 'cnt==100' is redundant or the