diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-09-05 20:17:31 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-09-05 20:17:31 +0000 |
commit | 9a519bae7c9a1819168d10e710af29f368c1ea3c (patch) | |
tree | 63955e695b484125f0f0c78e7a0472861758fe41 /sys/net/bpf.c | |
parent | 93e281cf78b7933772ba0a44023fa320af362ad8 (diff) |
make bpfread return ENXIO if a read is attempted on an uninitialized
descriptor; newsham@secnet.com
Diffstat (limited to 'sys/net/bpf.c')
-rw-r--r-- | sys/net/bpf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index a3e4f17c32a..f64776a88f6 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bpf.c,v 1.10 1997/08/31 20:42:29 deraadt Exp $ */ +/* $OpenBSD: bpf.c,v 1.11 1997/09/05 20:17:30 deraadt Exp $ */ /* $NetBSD: bpf.c,v 1.33 1997/02/21 23:59:35 thorpej Exp $ */ /* @@ -439,6 +439,9 @@ bpfread(dev, uio, ioflag) int error; int s; + if (d->bd_bif == 0) + return (ENXIO); + /* * Restrict application to use a buffer the same size as * as kernel buffers. |