summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-07-22 09:54:10 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-07-22 09:54:10 +0000
commit7ecbda55eba75756d87cd63f746fc34b0af91d19 (patch)
treed3cf6e9f9ca90dcb77e7010fc1e6f1b4c096b7bc
parent8d31b58e975534036dbcf161328ed883f33ad119 (diff)
Prevent NULL-pointer call for filesystems that don't provide vfs_sysctl
in their vfsops. Issue reported by Tim Newsham. ok claudio@, natano@
-rw-r--r--sys/kern/vfs_subr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 7411a924724..661b5de0597 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.248 2016/06/19 11:54:33 natano Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.249 2016/07/22 09:54:09 kettenis Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -1290,7 +1290,7 @@ vfs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
if (vfsp->vfc_typenum == name[0])
break;
- if (vfsp == NULL)
+ if (vfsp == NULL || vfsp->vfc_vfsops->vfs_sysctl == NULL)
return (EOPNOTSUPP);
return ((*vfsp->vfc_vfsops->vfs_sysctl)(&name[1], namelen - 1,