DragonFlyBSD Kernel Audit
DF-0244 / fix.diff
← back to finding ↓ download raw
diff --git a/kern/tty_conf.c b/kern/tty_conf.c
--- a/kern/tty_conf.c
+++ b/kern/tty_conf.c
@@ -123,7 +123,7 @@
 ldisc_deregister(int discipline)
 {
 	lwkt_gettoken(&tty_token);
-	if (discipline < MAXLDISC) {
+	if (discipline >= 0 && discipline < MAXLDISC) {
 		linesw[discipline] = nodisc;
 	}
 	lwkt_reltoken(&tty_token);