diff options
Diffstat (limited to 'sys/arch/sun3/dev/bt_subr.c')
-rw-r--r-- | sys/arch/sun3/dev/bt_subr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/sun3/dev/bt_subr.c b/sys/arch/sun3/dev/bt_subr.c index d51468ad11e..17022d60069 100644 --- a/sys/arch/sun3/dev/bt_subr.c +++ b/sys/arch/sun3/dev/bt_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bt_subr.c,v 1.2 1997/01/16 04:03:42 kstailey Exp $ */ +/* $OpenBSD: bt_subr.c,v 1.3 2002/08/02 16:13:07 millert Exp $ */ /* $NetBSD: bt_subr.c,v 1.2 1995/04/10 22:12:48 gwr Exp $ */ /* @@ -74,7 +74,7 @@ bt_getcmap(p, cm, cmsize) start = p->index; count = p->count; - if (start >= cmsize || start + count > cmsize) + if (start >= cmsize || count > cmsize - start) return (EINVAL); if (!useracc(p->red, count, B_WRITE) || !useracc(p->green, count, B_WRITE) || @@ -102,7 +102,7 @@ bt_putcmap(p, cm, cmsize) start = p->index; count = p->count; - if (start >= cmsize || start + count > cmsize) + if (start >= cmsize || count > cmsize - start) return (EINVAL); if (!useracc(p->red, count, B_READ) || !useracc(p->green, count, B_READ) || |