From 1c30b4adbd2b6884bbe680ae794f28ae50a0ca30 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Fri, 28 Oct 2016 20:06:40 +0200 Subject: [PATCH] conf/ile: use lxc_safe_uint() in config_tty() Signed-off-by: Christian Brauner --- src/lxc/conf.h | 2 +- src/lxc/confile.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lxc/conf.h b/src/lxc/conf.h index 3a23f55a1..4fd5b108a 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -293,7 +293,7 @@ struct saved_nic { struct lxc_conf { int is_execute; char *fstab; - int tty; + unsigned int tty; unsigned int pts; int reboot; int need_utmp_watch; diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 614baacf6..b6d5af001 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -1260,9 +1260,8 @@ freak_out: static int config_tty(const char *key, const char *value, struct lxc_conf *lxc_conf) { - int nbtty = atoi(value); - - lxc_conf->tty = nbtty; + if (lxc_safe_uint(value, &lxc_conf->tty) < 0) + return -1; return 0; } -- 2.39.5