From 179199697979d3f5d912b9991f581ef06f93c9e6 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Fri, 28 Oct 2016 19:58:10 +0200 Subject: [PATCH] conf/ile: use lxc_safe_uint() in config_pts() 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 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; } -- 2.47.3