summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-trace.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2017-08-17 15:12:55 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-08-17 16:39:14 -0300
commitd6d4fc6fefda26a88eb99d30e87a8834c59c144a (patch)
tree0cfa282ccd810ab1a897852bbcd55d1ec9f0697d /tools/perf/builtin-trace.c
parentc73881eeb1a0ee9b45d8bc9f45ab02e23d81c5c5 (diff)
downloadlinux-rpi-d6d4fc6fefda26a88eb99d30e87a8834c59c144a.tar.gz
linux-rpi-d6d4fc6fefda26a88eb99d30e87a8834c59c144a.tar.bz2
linux-rpi-d6d4fc6fefda26a88eb99d30e87a8834c59c144a.zip
perf trace: Fix off by one string allocation problem
We need to consider the null terminator, oops, fix it. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Fixes: 017037ff3d0b ("perf trace: Allow specifying list of syscalls and events in -e/--expr/--event") Link: http://lkml.kernel.org/n/tip-j79jpqqe91gvxqmsgxgfn2ni@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r--tools/perf/builtin-trace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index de02413a25d3..91905839e386 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2806,7 +2806,7 @@ static int trace__parse_events_option(const struct option *opt, const char *str,
struct trace *trace = (struct trace *)opt->value;
const char *s = str;
char *sep = NULL, *lists[2] = { NULL, NULL, };
- int len = strlen(str), err = -1, list;
+ int len = strlen(str) + 1, err = -1, list;
char *strace_groups_dir = system_path(STRACE_GROUPS_DIR);
char group_name[PATH_MAX];