diff options
author | kib <kib@FreeBSD.org> | 2008-08-06 14:47:19 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-08-06 14:47:19 +0000 |
commit | 28272d34d6a79de86296772defceaf12e49f2ffa (patch) | |
tree | 459f324954fe312435853ea152920b8afa87459f /sys/ufs | |
parent | ea3d7030c0c6118b636ea8909a5583b94d819e3a (diff) | |
download | FreeBSD-src-28272d34d6a79de86296772defceaf12e49f2ffa.zip FreeBSD-src-28272d34d6a79de86296772defceaf12e49f2ffa.tar.gz |
User may do "mount -o snapshot ...", that causes new FFS mount to be
performed with snapshot option, while the mp->mnt_opt is NULL.
Protect against NULL pointer dereference.
Noted by: Mateusz Guzik <mjguzik gmail com>
MFC after: 3 days
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 5ee123a..4d9754e 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -169,7 +169,8 @@ ffs_mount(struct mount *mp, struct thread *td) * persist "snapshot" in the options list. */ vfs_deleteopt(mp->mnt_optnew, "snapshot"); - vfs_deleteopt(mp->mnt_opt, "snapshot"); + if (mp->mnt_opt != NULL) + vfs_deleteopt(mp->mnt_opt, "snapshot"); } MNT_ILOCK(mp); |