diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-08-11 17:43:06 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-08-11 17:43:06 +0000 |
commit | 85bbe59acde7c3ad717a786a6f123cf74a132632 (patch) | |
tree | a2d1c9b978d3151fce77a608bdbeafc43d2744b6 | |
parent | 2b4ad982498b4e1263c39afed96e50b238678d9b (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.c | 5 |
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); |