mount: fix gcc7 format-overflow errors
authorHans Dedecker <dedeckeh@gmail.com>
Fri, 4 Jan 2019 10:27:47 +0000 (11:27 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Fri, 4 Jan 2019 10:28:37 +0000 (11:28 +0100)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
mount.c

diff --git a/mount.c b/mount.c
index 26e416e..2d5114c 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -394,7 +394,7 @@ static char* mount_get_serial(char *dev)
                                {
                                        int id;
                                        struct stat buf;
-                                       char tmp3[255];
+                                       char tmp3[strlen(namelist[n]->d_name) + strlen(dev) + 31];
                                        int ret;
                                        *t = 0;
                                        id = atoi(namelist[n]->d_name);