]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: fix mount option parsing 3846/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 19 May 2021 15:38:20 +0000 (17:38 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 19 May 2021 15:38:20 +0000 (17:38 +0200)
Fixes: Coverity 1484906
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 30d5a86d3fa9d7f2717aca8378b1583bd04059ee..9e3d79a0d91956c391d00b4a44aa2560b9f75fa6 100644 (file)
@@ -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) {