DragonFlyBSD Kernel Audit
DF-0208 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/kern/tty_subr.c b/sys/kern/tty_subr.c
--- a/sys/kern/tty_subr.c
+++ b/sys/kern/tty_subr.c
@@ -130,6 +130,8 @@
 	int i;
 	short c;
 
+	if (n < 0)
+		n = 0;
 	if (n > cl->c_cc)
 		n = cl->c_cc;
 	count = n;