Skip to content

Commit

Permalink
tracing: Fix off-by-one in trace_get_user()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Sep 22, 2009
1 parent b8c7f1d commit 3c235a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3c235a3

Please sign in to comment.