]> git.baikalelectronics.ru Git - kernel.git/commit
perf ui/tui: Fix off-by-one in hist_browser__update_nr_entries()
authorNamhyung Kim <namhyung@kernel.org>
Tue, 22 Apr 2014 04:56:11 +0000 (13:56 +0900)
committerJiri Olsa <jolsa@kernel.org>
Thu, 24 Apr 2014 14:33:08 +0000 (16:33 +0200)
commit269993109fc867e41ef260ecff0d0daf3a088b5b
tree711a90b3c494a19dab524c8482b20eff2d4ee665
parentb59328bd97b0ce5fa4119501356ab29f6c71085a
perf ui/tui: Fix off-by-one in hist_browser__update_nr_entries()

The nr_entries variable is increased inside the loop in the function
but it always count the first entry regardless of it's filtered or
not; caused an off-by-one error.

It'd become a problem especially there's no entry at all - it'd get a
segfault during referencing a NULL pointer.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1398327843-31845-9-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
tools/perf/ui/browsers/hists.c