tracing/function-graph: Use correct string size for snprintf
commitd62f85d1e22e537192ce494c89540e1ac0d8bfc7
authorChase Douglas <chase.douglas@canonical.com>
Tue, 15 Jun 2010 16:29:15 +0000 (15 12:29 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 29 Jun 2010 01:11:39 +0000 (28 21:11 -0400)
tree6ea77c37dbdc9d0b82ca93ace71ffe5f44f234d3
parent67ead0a6ceb001b4cb891d782e440f0e79493ba2
tracing/function-graph: Use correct string size for snprintf

The nsecs_str string is a local variable defined as:

char nsecs_str[5];

It is possible for the snprintf call to use a size value larger than the
size of the string. This should not cause a buffer overrun as it is
written now due to the value for the string format "%03lu" can not be
larger than 1000. However, this change makes it correct. By making the
size correct we guard against potential future changes that could actually
cause a buffer overrun.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
LKML-Reference: <1276619355-18116-1-git-send-email-chase.douglas@canonical.com>

[ added 'UL' to number 8 to fix gcc warning comparing it to sizeof() ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_functions_graph.c