diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-11-20 15:57:26 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-11-20 15:57:26 +0000 |
commit | ecd1eefababcba78141cf35e53ce1986f3041da8 (patch) | |
tree | 6a753b12df8dbc8d426b35ed136631986c0d11da /sys/arch/sparc/dev/cgfourteen.c | |
parent | 449e79b885b59db7893cf4f923168ccc0a9f7b8f (diff) |
careful off handling in mmap routines
Diffstat (limited to 'sys/arch/sparc/dev/cgfourteen.c')
-rw-r--r-- | sys/arch/sparc/dev/cgfourteen.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/arch/sparc/dev/cgfourteen.c b/sys/arch/sparc/dev/cgfourteen.c index 2786bb6a9ff..052b245c11b 100644 --- a/sys/arch/sparc/dev/cgfourteen.c +++ b/sys/arch/sparc/dev/cgfourteen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgfourteen.c,v 1.1 1997/08/08 08:24:48 downsj Exp $ */ +/* $OpenBSD: cgfourteen.c,v 1.2 1998/11/20 15:57:21 deraadt Exp $ */ /* $NetBSD: cgfourteen.c,v 1.7 1997/05/24 20:16:08 pk Exp $ */ /* @@ -577,6 +577,9 @@ cgfourteenmmap(dev, off, prot) if (off & PGOFSET) panic("cgfourteenmmap"); + if (off < 0) + return (-1); + #if defined(DEBUG) && defined(CG14_MAP_REGS) /* XXX: security hole */ /* * Map the control registers into user space. Should only be |