]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: use lxc_safe_int()
authorChristian Brauner <christian.brauner@canonical.com>
Sat, 29 Oct 2016 10:08:00 +0000 (12:08 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 22 Nov 2016 04:59:29 +0000 (23:59 -0500)
Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
src/lxc/start.c

index f3efb6ac9c632cb192d5ea01e19e41782d66590b..0ca5ba085486b6c8f964df895b4f844abef4eecc 100644 (file)
@@ -215,7 +215,10 @@ restart:
                if (!strcmp(direntp->d_name, ".."))
                        continue;
 
-               fd = atoi(direntp->d_name);
+               if (lxc_safe_int(direntp->d_name, &fd) < 0) {
+                       INFO("Could not parse file descriptor for: %s", direntp->d_name);
+                       continue;
+               }
 
                if (fd == fddir || fd == lxc_log_fd || fd == fd_to_ignore)
                        continue;