Skip to content

Commit 437889b

Browse files
Artem Sadovnikovrostedt
authored andcommitted
fgraph: Make pid_str size match the comment
The comment above buffer mentions sign, 10 bytes width for number and null terminator, but buffer itself isn't large enough to hold that much data. This is a cosmetic change, since PID cannot be negative, other than -1. Found by Linux Verification Center (linuxtesting.org) with SVACE. Link: https://lore.kernel.org/20250617152110.2530-1-a.sadovnikov@ispras.ru Signed-off-by: Artem Sadovnikov <a.sadovnikov@ispras.ru> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent d7b8f8e commit 437889b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

kernel/trace/trace_functions_graph.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ static void print_graph_proc(struct trace_seq *s, pid_t pid)
513513
{
514514
char comm[TASK_COMM_LEN];
515515
/* sign + log10(MAX_INT) + '\0' */
516-
char pid_str[11];
516+
char pid_str[12];
517517
int spaces = 0;
518518
int len;
519519
int i;

0 commit comments

Comments
 (0)