diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-11-21 18:25:49 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-11-21 18:25:49 +0000 |
commit | 8bfce71941c8187b51777a022add42aac4668624 (patch) | |
tree | e5d982944c4f75f8e632747a5a52d454d2463d0c /sys | |
parent | b9ec5c20db70cb2d07e069d43dfde762793098b0 (diff) |
when mmap'ing check for offset >= size, not just > size and disallow negative offsets; mrg@netbsd.org
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/alpha/pci/tga.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/alpha/pci/tga.c b/sys/arch/alpha/pci/tga.c index 0185ce99ba9..7f64fed2b0a 100644 --- a/sys/arch/alpha/pci/tga.c +++ b/sys/arch/alpha/pci/tga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tga.c,v 1.11 1997/11/06 12:27:04 niklas Exp $ */ +/* $OpenBSD: tga.c,v 1.12 1998/11/21 18:25:48 millert Exp $ */ /* $NetBSD: tga.c,v 1.13 1996/12/05 01:39:37 cgd Exp $ */ /* @@ -405,7 +405,7 @@ tgammap(v, offset, prot) { struct tga_softc *sc = v; - if (offset > sc->sc_dc->dc_tgaconf->tgac_cspace_size) + if (offset >= sc->sc_dc->dc_tgaconf->tgac_cspace_size || offset < 0) return -1; return alpha_btop(sc->sc_dc->dc_paddr + offset); } |