From dbbd8d400ac9dc490844c55de3e09a9c583e2134 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Thu, 6 Dec 2012 15:50:41 +0300 Subject: [PATCH] rst: Don't allocate PATH_MAX on stack for proc mountpoint Use direct name assignment, it's enough. Signed-off-by: Pavel Emelyanov --- cr-restore.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cr-restore.c b/cr-restore.c index 095d73992..3be05dde2 100644 --- a/cr-restore.c +++ b/cr-restore.c @@ -968,9 +968,8 @@ static void restore_pgid(void) static int mount_proc(void) { int ret; - char proc_mountpoint[PATH_MAX]; + char proc_mountpoint[] = "crtools-proc.XXXXXX"; - snprintf(proc_mountpoint, sizeof(proc_mountpoint), "crtools-proc.XXXXXX"); if (mkdtemp(proc_mountpoint) == NULL) { pr_perror("mkdtemp failed %s", proc_mountpoint); return -1;