conf/ile: use lxc_safe_uint() in config_tty()

Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
This commit is contained in:
Christian Brauner 2016-10-28 20:06:40 +02:00
parent 226dc30e4f
commit 1c30b4adbd
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D
2 changed files with 3 additions and 4 deletions

View File

@ -293,7 +293,7 @@ struct saved_nic {
struct lxc_conf { struct lxc_conf {
int is_execute; int is_execute;
char *fstab; char *fstab;
int tty; unsigned int tty;
unsigned int pts; unsigned int pts;
int reboot; int reboot;
int need_utmp_watch; int need_utmp_watch;

View File

@ -1260,9 +1260,8 @@ freak_out:
static int config_tty(const char *key, const char *value, static int config_tty(const char *key, const char *value,
struct lxc_conf *lxc_conf) struct lxc_conf *lxc_conf)
{ {
int nbtty = atoi(value); if (lxc_safe_uint(value, &lxc_conf->tty) < 0)
return -1;
lxc_conf->tty = nbtty;
return 0; return 0;
} }