diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1998-11-21 18:02:29 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1998-11-21 18:02:29 +0000 |
commit | 98eb0f928d964b2558b459890120f7d7f10573e8 (patch) | |
tree | bda7146d37d53176c4d54af3b6d23d64ecfd12ae /sys/dev | |
parent | 81e5fe486e0cc2fb435949fdd9479c3855e1b11c (diff) |
check for negative off in mmap
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/wscons/wscons.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/wscons/wscons.c b/sys/dev/wscons/wscons.c index ea1bdffd003..31cfce1b97a 100644 --- a/sys/dev/wscons/wscons.c +++ b/sys/dev/wscons/wscons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wscons.c,v 1.7 1998/08/15 22:47:53 kstailey Exp $ */ +/* $OpenBSD: wscons.c,v 1.8 1998/11/21 18:02:28 niklas Exp $ */ /* $NetBSD: wscons.c,v 1.10 1996/12/05 01:39:47 cgd Exp $ */ /* @@ -393,6 +393,8 @@ wsconsmmap(dev, offset, prot) { struct wscons_softc *sc = wscons_cd.cd_devs[WSCUNIT(dev)]; + if (offset < 0) + return -1; if (sc->sc_mmap != NULL) return (*sc->sc_mmap)(sc->sc_dev.dv_parent, offset, prot); else |