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.4.2~11 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3190ce431d58dc404cdd06701c63103ec2f9521d;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 f69b3ba3d..75288cd0a 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");