[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160615032753.31330.76279.stgit@devbox>
Date: Wed, 15 Jun 2016 12:27:53 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
linux-kernel@...r.kernel.org, Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Hemant Kumar <hemant@...ux.vnet.ibm.com>,
Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>,
Brendan Gregg <brendan.d.gregg@...il.com>
Subject: [PATCH perf/core v11 02/20] perf-probe: Fix to add NULL check for strndup
Fix to add a NULL check for strndup when parsing
probe trace command.
Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
---
Changes in v10:
- Splited from "perf probe: Allow wildcard for cached events"
---
tools/perf/util/probe-event.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 74401a2..7ae3dd1 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -1603,6 +1603,10 @@ int parse_probe_trace_command(const char *cmd, struct probe_trace_event *tev)
p = strchr(argv[1], ':');
if (p) {
tp->module = strndup(argv[1], p - argv[1]);
+ if (!tp->module) {
+ ret = -ENOMEM;
+ goto out;
+ }
p++;
} else
p = argv[1];
Powered by blists - more mailing lists