From: Christian Brauner Date: Sat, 29 Oct 2016 10:08:00 +0000 (+0200) Subject: start: use lxc_safe_int() X-Git-Tag: lxc-2.1.0~257^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4cff0d21a47b7de567b343a4de9695021eb5dfe;p=thirdparty%2Flxc.git start: use lxc_safe_int() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/start.c b/src/lxc/start.c index f36653dff..71206e036 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -223,7 +223,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;