diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-01-18 10:48:20 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-01-18 10:48:20 +0000 |
commit | 390f543cf7f06384ee4a2bad1711b9cf034a0666 (patch) | |
tree | 7d6c905f4f3c22f6ce0296d3a430e8bd0ab2aa27 | |
parent | 5cc29ca4dccd015d3f6305a0e0fbc2623c252fb9 (diff) |
Correct mmap() bounds check.
-rw-r--r-- | sys/arch/hp300/dev/diofb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/arch/hp300/dev/diofb.c b/sys/arch/hp300/dev/diofb.c index fbf8b3c8150..b66710dd9ac 100644 --- a/sys/arch/hp300/dev/diofb.c +++ b/sys/arch/hp300/dev/diofb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diofb.c,v 1.2 2005/01/16 16:14:09 miod Exp $ */ +/* $OpenBSD: diofb.c,v 1.3 2005/01/18 10:48:19 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -463,7 +463,7 @@ diofb_mmap(void * v, off_t offset, int prot) if (offset & PGOFSET) return (-1); - if (offset < 0 || offset > fb->fbsize) + if (offset < 0 || offset >= fb->fbsize) return (-1); return (((paddr_t)fb->fbaddr + offset) >> PGSHIFT); |