From 3885978f9a2c6ce4f264a7466f04a662304e9713 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 21 Nov 1998 18:13:05 +0000 Subject: when mmap'ing check for offset >= size, not just > size and disallow negative offsets; mrg@netbsd.org --- sys/arch/alpha/tc/cfb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/arch/alpha/tc/cfb.c') diff --git a/sys/arch/alpha/tc/cfb.c b/sys/arch/alpha/tc/cfb.c index a59a77f225f..622aa607dc9 100644 --- a/sys/arch/alpha/tc/cfb.c +++ b/sys/arch/alpha/tc/cfb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cfb.c,v 1.9 1997/11/06 12:27:05 niklas Exp $ */ +/* $OpenBSD: cfb.c,v 1.10 1998/11/21 18:13:03 millert Exp $ */ /* $NetBSD: cfb.c,v 1.7 1996/12/05 01:39:39 cgd Exp $ */ /* @@ -303,8 +303,8 @@ cfbmmap(v, offset, prot) { struct cfb_softc *sc = v; - if (offset > CFB_SIZE) - return -1; + if (offset >= CFB_SIZE || offset < 0) + return (-1); return alpha_btop(sc->sc_dc->dc_paddr + offset); } -- cgit v1.2.3