]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fstab-generator: fix new NULL dereference. (#6296)
authorNeilBrown <neil@brown.name>
Thu, 6 Jul 2017 02:53:41 +0000 (12:53 +1000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 6 Jul 2017 02:53:41 +0000 (22:53 -0400)
fstype can be NULL, particularly when called from add_sysroot_mount(),
so we need to use STRPTR_IN_SET().

src/fstab-generator/fstab-generator.c

index 7688a75f1258a48b7234ee150bde8f122db1cadf..ce9dccfe68c6689577ba128a928205c7502e15da 100644 (file)
@@ -358,7 +358,7 @@ static int add_mount(
                 "Documentation=man:fstab(5) man:systemd-fstab-generator(8)\n",
                 source);
 
-        if (STR_IN_SET(fstype, "nfs", "nfs4") && !automount &&
+        if (STRPTR_IN_SET(fstype, "nfs", "nfs4") && !automount &&
             fstab_test_yes_no_option(opts, "bg\0" "fg\0")) {
                 /* The default retry timeout that mount.nfs uses for 'bg' mounts
                  * is 10000 minutes, where as it uses 2 minutes for 'fg' mounts.