summaryrefslogtreecommitdiffstats
path: root/src/fstab-generator
diff options
context:
space:
mode:
authorNeilBrown <neil@brown.name>2017-07-06 04:53:41 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-06 04:53:41 +0200
commit86086fce66f7c12168c7dfb699fb6dcc5b54a5f2 (patch)
tree58222023e651b25e93c5875fb8215fca6d59cf9f /src/fstab-generator
parentMerge pull request #6236 from yuwata/mount-loop (diff)
downloadsystemd-86086fce66f7c12168c7dfb699fb6dcc5b54a5f2.tar.xz
systemd-86086fce66f7c12168c7dfb699fb6dcc5b54a5f2.zip
fstab-generator: fix new NULL dereference. (#6296)
fstype can be NULL, particularly when called from add_sysroot_mount(), so we need to use STRPTR_IN_SET().
Diffstat (limited to 'src/fstab-generator')
-rw-r--r--src/fstab-generator/fstab-generator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 7688a75f12..ce9dccfe68 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -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.