]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf/ile: use lxc_safe_uint() in config_pts()
authorChristian Brauner <christian.brauner@canonical.com>
Fri, 28 Oct 2016 17:58:10 +0000 (19:58 +0200)
committerChristian Brauner <christian.brauner@canonical.com>
Tue, 22 Nov 2016 02:41:13 +0000 (03:41 +0100)
Signed-off-by: Christian Brauner <christian.brauner@canonical.com>
src/lxc/conf.h
src/lxc/confile.c

index 7fb8ae8e7f1e4c155bb9f7e86bac34d9bb573a6e..f848c5772a6e2bba996d4bda95ea52b59b24c8ef 100644 (file)
@@ -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;
index ff06d3176bedf0ccf309d03acbb6c239cb33e499..c24663e48ce19a4daae33280c2ffd2cd3eb0d8c4 100644 (file)
@@ -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;
 }