summaryrefslogtreecommitdiff
path: root/sys/arch/mvme68k/dev/flash.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-07-03 14:36:35 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-07-03 14:36:35 +0000
commitf67a7215fd9cb58925ec5da43a2f29466f8ac6a0 (patch)
treee302ca11b942ad2c36e03f327ac468a7d931bd27 /sys/arch/mvme68k/dev/flash.c
parent65cbe19b94884cd565699e57b7922998058b0182 (diff)
Oops, one more mmap() bounds check.
Diffstat (limited to 'sys/arch/mvme68k/dev/flash.c')
-rw-r--r--sys/arch/mvme68k/dev/flash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/mvme68k/dev/flash.c b/sys/arch/mvme68k/dev/flash.c
index a2fcb412b68..fedb067a285 100644
--- a/sys/arch/mvme68k/dev/flash.c
+++ b/sys/arch/mvme68k/dev/flash.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: flash.c,v 1.13 2004/01/14 20:50:48 miod Exp $ */
+/* $OpenBSD: flash.c,v 1.14 2004/07/03 14:36:34 miod Exp $ */
/*
* Copyright (c) 1995 Theo de Raadt
@@ -486,7 +486,7 @@ flashmmap(dev, off, prot)
struct flashsoftc *sc = (struct flashsoftc *) flash_cd.cd_devs[unit];
/* allow access only in RAM */
- if (off > sc->sc_len)
+ if (off < 0 || off > sc->sc_len)
return (-1);
return (m68k_btop(sc->sc_paddr + off));
}