summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1998-11-20 16:55:59 +0000
committerderaadt <deraadt@openbsd.org>1998-11-20 16:55:59 +0000
commit3577f15074b5df089fc617cfc972bad1a60059f5 (patch)
tree6ef00a875534b7cc69df39cb6c2137f3aeab8794
parentcareful with mmap off (diff)
downloadwireguard-openbsd-3577f15074b5df089fc617cfc972bad1a60059f5.tar.xz
wireguard-openbsd-3577f15074b5df089fc617cfc972bad1a60059f5.zip
careful mmap
-rw-r--r--sys/dev/pci/brooktree848.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/pci/brooktree848.c b/sys/dev/pci/brooktree848.c
index b94ceea25ae..0bf1be76596 100644
--- a/sys/dev/pci/brooktree848.c
+++ b/sys/dev/pci/brooktree848.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brooktree848.c,v 1.4 1998/10/10 06:39:23 downsj Exp $ */
+/* $OpenBSD: brooktree848.c,v 1.5 1998/11/20 16:55:59 deraadt Exp $ */
/* $FreeBSD: brooktree848.c,v 1.56 1998/10/01 09:35:48 sos Exp $ */
/* BT848 Driver for Brooktree's Bt848 based cards.
The Brooktree BT848 Driver driver is based upon Mark Tinguely and
@@ -3394,6 +3394,8 @@ bktr_mmap( dev_t dev, int offset, int nprot )
if (nprot & PROT_EXEC)
return( -1 );
+ if (offset < 0)
+ return (-1);
if (offset >= bktr->alloc_pages * PAGE_SIZE)
return( -1 );