From 380fcc086301c9b966d80d02dc3374ceea83dbeb Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 19 May 2021 17:38:20 +0200 Subject: [PATCH] conf: fix mount option parsing Fixes: Coverity 1484906 Signed-off-by: Christian Brauner --- src/lxc/conf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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) { -- 2.47.2