diff options
author | 2003-08-11 17:43:05 +0000 | |
---|---|---|
committer | 2003-08-11 17:43:05 +0000 | |
commit | 3832b9fd9698ed42efd3cc54cd4c1754321a216a (patch) | |
tree | 9fe22edef604a5222ccc80336ea13771c7d189af | |
parent | add GSSAPI. ok deraadt@ (diff) | |
download | wireguard-openbsd-3832b9fd9698ed42efd3cc54cd4c1754321a216a.tar.xz wireguard-openbsd-3832b9fd9698ed42efd3cc54cd4c1754321a216a.zip |
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); |