]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: check config realpath for errors
authorEric Sandeen <sandeen@redhat.com>
Tue, 19 Jun 2018 20:43:02 +0000 (15:43 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 19 Jun 2018 20:43:02 +0000 (15:43 -0500)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/config.c

index 3a389adeedbead64e63a49e60e58b67692021601..9954691b09709f2cd3597c62ba129398fa130cc7 100644 (file)
@@ -573,7 +573,8 @@ open_config_file(
                        goto out;
                }
                /* Get absolute path to this file */
-               realpath(config_file, *fpath);
+               if (!realpath(config_file, *fpath))
+                       goto out;
                fd = openat(AT_FDCWD, config_file, O_NOFOLLOW, O_RDONLY);
        }