]> git.baikalelectronics.ru Git - kernel.git/commit
perf intel-pt: Fix off-by-one comparison on maximum code
authorColin Ian King <colin.king@canonical.com>
Sun, 24 Apr 2016 18:56:43 +0000 (19:56 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 25 Apr 2016 23:35:59 +0000 (20:35 -0300)
commit02edf25ad06d59c58292693c9ab8397633187704
tree2ae1f9be240f18add8a931100d07ca417fad2aca
parent12b1e91796945bbf34c501469364a60ad8e8ed73
perf intel-pt: Fix off-by-one comparison on maximum code

The check for the maximum code is off-by-one; the current comparison of
a code that is INTEL_PT_ERR_MAX will cause the strlcpy to perform an out
of bounds array access on the intel_pt_err_msgs array.

Fix this with a >= comparison.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1461524203-10224-1-git-send-email-colin.king@canonical.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/intel-pt-decoder/intel-pt-decoder.c