diff options
author | 1998-11-21 18:02:28 +0000 | |
---|---|---|
committer | 1998-11-21 18:02:28 +0000 | |
commit | 3074e0e6f47a803bd804446387fbaee76720596d (patch) | |
tree | 869355e332caaa0a911f3d2190a1fbc3799fde41 | |
parent | missed an include (diff) | |
download | wireguard-openbsd-3074e0e6f47a803bd804446387fbaee76720596d.tar.xz wireguard-openbsd-3074e0e6f47a803bd804446387fbaee76720596d.zip |
check for negative off in mmap
-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 |