From: Christian Brauner Date: Fri, 28 Oct 2016 17:58:10 +0000 (+0200) Subject: conf/ile: use lxc_safe_uint() in config_pts() X-Git-Tag: lxc-2.1.0~257^2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=179199697979d3f5d912b9991f581ef06f93c9e6;p=thirdparty%2Flxc.git conf/ile: use lxc_safe_uint() in config_pts() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.h b/src/lxc/conf.h index 7fb8ae8e7..f848c5772 100644 --- a/src/lxc/conf.h +++ b/src/lxc/conf.h @@ -294,7 +294,7 @@ struct lxc_conf { int is_execute; char *fstab; int tty; - int pts; + unsigned int pts; int reboot; int need_utmp_watch; signed long personality; diff --git a/src/lxc/confile.c b/src/lxc/confile.c index ff06d3176..c24663e48 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -1142,9 +1142,8 @@ static int config_personality(const char *key, const char *value, static int config_pts(const char *key, const char *value, struct lxc_conf *lxc_conf) { - int maxpts = atoi(value); - - lxc_conf->pts = maxpts; + if (lxc_safe_uint(value, &lxc_conf->pts) < 0) + return -1; return 0; }