From: Christian Brauner Date: Fri, 28 Oct 2016 18:06:40 +0000 (+0200) Subject: conf/ile: use lxc_safe_uint() in config_tty() X-Git-Tag: lxc-2.1.0~257^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c30b4adbd2b6884bbe680ae794f28ae50a0ca30;p=thirdparty%2Flxc.git conf/ile: use lxc_safe_uint() in config_tty() Signed-off-by: Christian Brauner --- 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; }