summaryrefslogtreecommitdiff
path: root/sys/dev/wscons
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-10-30 05:15:38 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-10-30 05:15:38 +0000
commit1bcb8391a8d0c1bfd8ade79b51a77c6cda4d16b9 (patch)
tree3f7f667c669343cbf58f407c80a4f6833f3a4c44 /sys/dev/wscons
parentcfd2a1d8e09b56baaf6860b757e2903386c399ef (diff)
do not allow setting autorepeat delays causing zero timeouts later.
pointed out for the case of del*=0 in pr@2156 by Juan Vera <juan@coredump.com.ar>.
Diffstat (limited to 'sys/dev/wscons')
-rw-r--r--sys/dev/wscons/wskbd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c
index accd8e064f5..28859003267 100644
--- a/sys/dev/wscons/wskbd.c
+++ b/sys/dev/wscons/wskbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wskbd.c,v 1.27 2001/10/25 14:30:43 drahn Exp $ */
+/* $OpenBSD: wskbd.c,v 1.28 2001/10/30 05:15:37 mickey Exp $ */
/* $NetBSD: wskbd.c,v 1.38 2000/03/23 07:01:47 thorpej Exp $ */
/*
@@ -966,6 +966,11 @@ getbell:
kkdp = &sc->sc_keyrepeat_data;
setkeyrepeat:
ukdp = (struct wskbd_keyrepeat_data *)data;
+ if ((ukdp->which & WSKBD_KEYREPEAT_DODEL1 &&
+ (hz * ukdp->del1) / 1000 <= 0) ||
+ (ukdp->which & WSKBD_KEYREPEAT_DODELN &&
+ (hz * ukdp->delN) / 1000 <= 0))
+ return (EINVAL);
SETKEYREPEAT(kkdp, ukdp, kkdp);
return (0);