From: Jérémie Galarneau Date: Fri, 4 Jul 2014 19:28:42 +0000 (-0400) Subject: Fix: static array larger than necessary X-Git-Tag: v2.5.0~27 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f2b2a1ab859e70c9c9f537b7e9dd01eea4226b28;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 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");