summaryrefslogtreecommitdiff
path: root/sys/arch/sun3
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2001-09-16 00:42:45 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2001-09-16 00:42:45 +0000
commitdcf53c92ea15715a4406b9230a1c68943501ffb2 (patch)
tree1d6ac3cb6ae47126af1dc54f4f0f5bac7afc49b7 /sys/arch/sun3
parent3b1414ef904bbd7e35b23fc1509a3ea20e822cae (diff)
Add some missing lengths checks when passing data from userland to
kernel. From based on NetBSD patches.
Diffstat (limited to 'sys/arch/sun3')
-rw-r--r--sys/arch/sun3/dev/cg2.c8
-rw-r--r--sys/arch/sun3/include/fbio.h6
2 files changed, 8 insertions, 6 deletions
diff --git a/sys/arch/sun3/dev/cg2.c b/sys/arch/sun3/dev/cg2.c
index aaed1f3412d..884934c33cc 100644
--- a/sys/arch/sun3/dev/cg2.c
+++ b/sys/arch/sun3/dev/cg2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cg2.c,v 1.6 1997/01/16 04:03:43 kstailey Exp $ */
+/* $OpenBSD: cg2.c,v 1.7 2001/09/16 00:42:44 millert Exp $ */
/* $NetBSD: cg2.c,v 1.7 1996/10/13 03:47:26 christos Exp $ */
/*
@@ -306,7 +306,8 @@ cg2getcmap(fb, cmap)
{
struct cg2_softc *sc = fb->fb_private;
u_char red[CMSIZE], green[CMSIZE], blue[CMSIZE];
- int error, start, count, ecount;
+ int error;
+ u_int start, count, ecount;
register u_int i;
register u_short *p;
@@ -348,7 +349,8 @@ cg2putcmap(fb, cmap)
{
struct cg2_softc *sc = fb->fb_private;
u_char red[CMSIZE], green[CMSIZE], blue[CMSIZE];
- int error, start, count, ecount;
+ int error;
+ u_int start, count, ecount;
register u_int i;
register u_short *p;
diff --git a/sys/arch/sun3/include/fbio.h b/sys/arch/sun3/include/fbio.h
index d5352e84c40..511daa3b24b 100644
--- a/sys/arch/sun3/include/fbio.h
+++ b/sys/arch/sun3/include/fbio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fbio.h,v 1.2 1997/09/21 04:21:09 niklas Exp $ */
+/* $OpenBSD: fbio.h,v 1.3 2001/09/16 00:42:44 millert Exp $ */
/* $NetBSD: fbio.h,v 1.3 1994/11/21 21:33:40 gwr Exp $ */
/*
@@ -105,8 +105,8 @@ struct fbinfo {
* Color map I/O.
*/
struct fbcmap {
- int index; /* first element (0 origin) */
- int count; /* number of elements */
+ u_int index; /* first element (0 origin) */
+ u_int count; /* number of elements */
u_char *red; /* red color map elements */
u_char *green; /* green color map elements */
u_char *blue; /* blue color map elements */