From 5f1abdd942402eca8534903be9f6c1cddaa09185 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 4 Jul 2014 15:28:42 -0400 Subject: [PATCH] Fix: static array larger than necessary The longest string that can be returned should be 20 chars long, as per the comment. Signed-off-by: David Goulet --- src/bin/lttng/commands/list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index 8c1d5af87..87935393e 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -107,7 +107,7 @@ static char *get_cmdline_by_pid(pid_t pid) int ret; FILE *fp; char *cmdline = NULL; - char path[24]; /* Can't go bigger than /proc/65535/cmdline */ + char path[20]; /* Can't go bigger than /proc/65535/cmdline */ snprintf(path, sizeof(path), "/proc/%d/cmdline", pid); fp = fopen(path, "r"); -- 2.34.1