From 829aae7b8d96ff53c1755cf571a6d951f4fae72c Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Sun, 25 Dec 2016 17:20:14 +0900 Subject: [PATCH] mcexec: PATH_MAX buffer lenght in do_generic_syscall() --- executer/user/mcexec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c index eb9fdae7..90c1e11d 100644 --- a/executer/user/mcexec.c +++ b/executer/user/mcexec.c @@ -1746,8 +1746,8 @@ do_generic_syscall( /* Overlayfs /sys/X directory lseek() problem work around */ if (w->sr.number == __NR_lseek && ret == -EINVAL) { - char proc_path[512]; - char path[512]; + char proc_path[PATH_MAX]; + char path[PATH_MAX]; struct stat sb; sprintf(proc_path, "/proc/self/fd/%d", (int)w->sr.args[0]); @@ -1756,6 +1756,7 @@ do_generic_syscall( if (readlink(proc_path, path, sizeof(path)) < 0) { fprintf(stderr, "%s: error: readlink() failed for %s\n", __FUNCTION__, proc_path); + perror(": "); goto out; }