From: Thomas Weißschuh Date: Sun, 24 Dec 2023 12:05:20 +0000 (+0100) Subject: libmount: (tests) fix --filesystems crash on invalid argument X-Git-Tag: v2.40-rc1~84^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2f43ebcda0ba8bea82ae65040cea76305077dbab;p=thirdparty%2Futil-linux.git libmount: (tests) fix --filesystems crash on invalid argument Signed-off-by: Thomas Weißschuh --- diff --git a/libmount/src/utils.c b/libmount/src/utils.c index b6d95696ad..056c5d4fb0 100644 --- a/libmount/src/utils.c +++ b/libmount/src/utils.c @@ -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);