From 28272d34d6a79de86296772defceaf12e49f2ffa Mon Sep 17 00:00:00 2001 From: kib Date: Wed, 6 Aug 2008 14:47:19 +0000 Subject: 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 MFC after: 3 days --- sys/ufs/ffs/ffs_vfsops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/ufs/ffs/ffs_vfsops.c') 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); -- cgit v1.1