[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-844faa4bcddc5d321311003ea3af9d808371c48e@git.kernel.org>
Date: Thu, 16 Jun 2016 01:32:07 -0700
From: tip-bot for Masami Hiramatsu <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: ananth@...ux.vnet.ibm.com, mingo@...nel.org, acme@...hat.com,
hemant@...ux.vnet.ibm.com, brendan.d.gregg@...il.com,
peterz@...radead.org, hpa@...or.com, tglx@...utronix.de,
linux-kernel@...r.kernel.org, mhiramat@...nel.org,
namhyung@...nel.org
Subject: [tip:perf/core] perf probe: Fix to add NULL check for strndup
Commit-ID: 844faa4bcddc5d321311003ea3af9d808371c48e
Gitweb: http://git.kernel.org/tip/844faa4bcddc5d321311003ea3af9d808371c48e
Author: Masami Hiramatsu <mhiramat@...nel.org>
AuthorDate: Wed, 8 Jun 2016 18:29:21 +0900
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Tue, 14 Jun 2016 09:29:54 -0300
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>
Cc: Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@...il.com>
Cc: Hemant Kumar <hemant@...ux.vnet.ibm.com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lkml.kernel.org/r/20160608092920.3116.63319.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
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