summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2009-09-22 07:51:54 +0200
committerIngo Molnar <mingo@elte.hu>2009-09-22 10:28:53 +0200
commit3c235a337e205da0f614e456be72881483dcde6e (patch)
tree73dee892e0cf269793c2193e235d9701fa9a3115
parentMerge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/ker... (diff)
downloadlinux-3c235a337e205da0f614e456be72881483dcde6e.tar.xz
linux-3c235a337e205da0f614e456be72881483dcde6e.zip
tracing: Fix off-by-one in trace_get_user()
Leave the last slot for the tailing '\0'. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Steven Rostedt <rostedt@goodmis.org> LKML-Reference: <4AB865FA.5080801@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/trace/trace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index a35925d222ba..ae17453dc0f9 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -415,7 +415,7 @@ int trace_get_user(struct trace_parser *parser, const char __user *ubuf,
/* read the non-space input */
while (cnt && !isspace(ch)) {
- if (parser->idx < parser->size)
+ if (parser->idx < parser->size - 1)
parser->buffer[parser->idx++] = ch;
else {
ret = -EINVAL;