summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2016-07-22 09:54:09 +0000
committerkettenis <kettenis@openbsd.org>2016-07-22 09:54:09 +0000
commite4b56cf059f99a955f4d97ca2e693a5563d26163 (patch)
tree9a0aae937ffdb9074982b71ded955660a5725564 /sys/kern/vfs_subr.c
parentadd a regression test (diff)
downloadwireguard-openbsd-e4b56cf059f99a955f4d97ca2e693a5563d26163.tar.xz
wireguard-openbsd-e4b56cf059f99a955f4d97ca2e693a5563d26163.zip
Prevent NULL-pointer call for filesystems that don't provide vfs_sysctl
in their vfsops. Issue reported by Tim Newsham. ok claudio@, natano@
Diffstat (limited to 'sys/kern/vfs_subr.c')
-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,