summaryrefslogtreecommitdiff
path: root/sys/arch/sun3/dev/cg2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/sun3/dev/cg2.c')
-rw-r--r--sys/arch/sun3/dev/cg2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/sun3/dev/cg2.c b/sys/arch/sun3/dev/cg2.c
index 5422ac1fe7e..59c94827178 100644
--- a/sys/arch/sun3/dev/cg2.c
+++ b/sys/arch/sun3/dev/cg2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cg2.c,v 1.11 2002/03/14 03:16:01 millert Exp $ */
+/* $OpenBSD: cg2.c,v 1.12 2002/08/02 16:13:07 millert Exp $ */
/* $NetBSD: cg2.c,v 1.7 1996/10/13 03:47:26 christos Exp $ */
/*
@@ -315,7 +315,7 @@ cg2getcmap(fb, cmap)
start = cmap->index;
count = cmap->count;
ecount = start + count;
- if (start >= CMSIZE || ecount > CMSIZE)
+ if (start >= CMSIZE || count > CMSIZE - start)
return (EINVAL);
/* XXX - Wait for retrace? */
@@ -358,7 +358,7 @@ cg2putcmap(fb, cmap)
start = cmap->index;
count = cmap->count;
ecount = start + count;
- if (start >= CMSIZE || ecount > CMSIZE)
+ if (start >= CMSIZE || count > CMSIZE - start)
return (EINVAL);
/* Copy from user space to local arrays. */