1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00

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().
This commit is contained in:
NeilBrown 2017-07-06 12:53:41 +10:00 committed by Zbigniew Jędrzejewski-Szmek
parent 0d5e394c01
commit 86086fce66

View 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.