Skip to content

Commit

Permalink
trace: strlen() return doesn't account for the NULL
Browse files Browse the repository at this point in the history
We need to add one to the strlen() return because of the NULL
character.  The type->name here generally comes from the kernel and I
don't think any of them come close to being MAX_TRACER_SIZE (100)
characters long so this is basically a cleanup.

Signed-off-by: Dan Carpenter <error27@gmail.com>
LKML-Reference: <20100710100644.GV19184@bicker>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Dan Carpenter authored and Steven Rostedt committed Jul 22, 2010
1 parent a484e54 commit 24a461d
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 @@ -739,7 +739,7 @@ __acquires(kernel_lock)
return -1;
}

if (strlen(type->name) > MAX_TRACER_SIZE) {
if (strlen(type->name) >= MAX_TRACER_SIZE) {
pr_info("Tracer has a name longer than %d\n", MAX_TRACER_SIZE);
return -1;
}
Expand Down

0 comments on commit 24a461d

Please sign in to comment.