From: Jérémie Galarneau Date: Fri, 4 Jul 2014 19:28:42 +0000 (-0400) Subject: Fix: static array larger than necessary X-Git-Url: http://git.liburcu.org/?a=commitdiff_plain;h=9c0ce9b13a8749bd26fb3d62a327d885a4ada879;p=lttng-tools.git 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 --- diff --git a/src/bin/lttng/commands/list.c b/src/bin/lttng/commands/list.c index fb034a3da..fee605fa8 100644 --- a/src/bin/lttng/commands/list.c +++ b/src/bin/lttng/commands/list.c @@ -104,7 +104,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");