]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: (tests) fix --filesystems crash on invalid argument
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 24 Dec 2023 12:05:20 +0000 (13:05 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Sun, 31 Dec 2023 12:06:02 +0000 (13:06 +0100)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libmount/src/utils.c

index b6d95696adf7f277bbe614a8f52874222d53fd22..056c5d4fb0a52e4f74cbfdd1b4c6e31c56005f1c 100644 (file)
@@ -1364,7 +1364,7 @@ static int test_filesystems(struct libmnt_test *ts __attribute__((unused)),
                return -1;
 
        rc = mnt_get_filesystems(&filesystems, argc == 2 ? argv[1] : NULL);
-       if (!rc) {
+       if (!rc && filesystems) {
                char **p;
                for (p = filesystems; *p; p++)
                        printf("%s\n", *p);