perf annotate: Fix heap overflow
authorIan Rogers <irogers@google.com>
Sat, 26 Oct 2019 03:56:44 +0000 (20:56 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 7 Nov 2019 11:30:18 +0000 (08:30 -0300)
commit5c65b1c0842f9daddc6aec4bdb4b5d898006be19
tree5a2de128a1859ed7d05f983c1c96043323e8970c
parent93730f85eb37d9cf592c18dad7e488abed09b461
perf annotate: Fix heap overflow

Fix expand_tabs that copies the source lines '\0' and then appends
another '\0' at a potentially out of bounds address.

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20191026035644.217548-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/annotate.c