summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-08-11 17:43:06 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-08-11 17:43:06 +0000
commit85bbe59acde7c3ad717a786a6f123cf74a132632 (patch)
treea2d1c9b978d3151fce77a608bdbeafc43d2744b6
parent2b4ad982498b4e1263c39afed96e50b238678d9b (diff)
Add signal number sanity checking to usl_sync_init(). This is not
strictly required since the signal routines do their own sanity checks, but this way the VT_SETMODE ioctl() gets a nice EINVAL. Potential problem pointed out by Jacques Vidrine; deraadt@ OK
-rw-r--r--sys/dev/wscons/wsdisplay_compat_usl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/wscons/wsdisplay_compat_usl.c b/sys/dev/wscons/wsdisplay_compat_usl.c
index f06275cdcb4..2c4b76ee8d0 100644
--- a/sys/dev/wscons/wsdisplay_compat_usl.c
+++ b/sys/dev/wscons/wsdisplay_compat_usl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplay_compat_usl.c,v 1.12 2003/04/27 11:22:54 ho Exp $ */
+/* $OpenBSD: wsdisplay_compat_usl.c,v 1.13 2003/08/11 17:43:05 millert Exp $ */
/* $NetBSD: wsdisplay_compat_usl.c,v 1.12 2000/03/23 07:01:47 thorpej Exp $ */
/*
@@ -107,6 +107,9 @@ usl_sync_init(scr, sdp, p, acqsig, relsig, frsig)
struct usl_syncdata *sd;
int res;
+ if (acqsig <= 0 || acqsig >= NSIG || relsig <= 0 || relsig >= NSIG ||
+ frsig <= 0 || frsig >= NSIG)
+ return (EINVAL);
sd = malloc(sizeof(struct usl_syncdata), M_DEVBUF, M_NOWAIT);
if (!sd)
return (ENOMEM);