From: Christian Brauner Date: Wed, 19 May 2021 15:38:20 +0000 (+0200) Subject: conf: fix mount option parsing X-Git-Tag: lxc-5.0.0~166^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3846%2Fhead;p=thirdparty%2Flxc.git conf: fix mount option parsing Fixes: Coverity 1484906 Signed-off-by: Christian Brauner --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 30d5a86d3..9e3d79a0d 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -2110,7 +2110,7 @@ static int parse_vfs_attr(struct lxc_mount_options *opts, char *opt, size_t size static int parse_mount_attrs(struct lxc_mount_options *opts, const char *mntopts) { __do_free char *mntopts_new = NULL, *mntopts_dup = NULL; - char *mntopt_cur = NULL; + char *end = NULL, *mntopt_cur = NULL; int ret; size_t size; @@ -2130,8 +2130,6 @@ static int parse_mount_attrs(struct lxc_mount_options *opts, const char *mntopts return ret_errno(ENOMEM); lxc_iterate_parts(mntopt_cur, mntopts_dup, ",") { - char *end = NULL; - /* This is a filesystem specific option. */ if (strchr(mntopt_cur, '=')) { if (!end) {