diff options
author | 2017-06-20 14:11:46 +0000 | |
---|---|---|
committer | 2017-06-20 14:11:46 +0000 | |
commit | 608dd9d157c752796f552d21c6e9d8296abd7990 (patch) | |
tree | 04a0dafc91157463f228b2c3ca5c9974507ef8c2 /sys | |
parent | Remove the IWM_FLAG_HW_INITED flag from iwm(4). This flag was redundant. (diff) | |
download | wireguard-openbsd-608dd9d157c752796f552d21c6e9d8296abd7990.tar.xz wireguard-openbsd-608dd9d157c752796f552d21c6e9d8296abd7990.zip |
Do not touch file pointers for which FILE_IS_USABLE() is false.
They're might not be fully constructed.
ok mpi@ deraadt@ bluhm@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_sysctl.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 16d1d279036..7b71ccfde26 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.328 2017/06/14 03:00:40 dlg Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.329 2017/06/20 14:11:46 gerhard Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -1327,6 +1327,7 @@ sysctl_file(int *name, u_int namelen, char *where, size_t *sizep, FREF(fp); do { if (fp->f_count > 1 && /* 0, +1 for our FREF() */ + FILE_IS_USABLE(fp) && (arg == 0 || fp->f_type == arg)) { int af, skip = 0; if (arg == DTYPE_SOCKET && fp->f_type == arg) { |