From 467e627672eaddc88a6121f809313d8451422f4e Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Mon, 12 Mar 2018 23:04:42 +0000 Subject: [PATCH] Use the stack for temporary storage in OTIOCCONS. The old code used the thread's pcb via the uap->data pointer. Reviewed by: ed Approved by: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14674 --- sys/kern/tty_compat.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/kern/tty_compat.c b/sys/kern/tty_compat.c index 8a4545c64e3f..b61e05859f93 100644 --- a/sys/kern/tty_compat.c +++ b/sys/kern/tty_compat.c @@ -262,9 +262,11 @@ tty_ioctl_compat(struct tty *tp, u_long com, caddr_t data, int fflag, fflag, td)); } - case OTIOCCONS: - *(int *)data = 1; - return (tty_ioctl(tp, TIOCCONS, data, fflag, td)); + case OTIOCCONS: { + int one = 1; + + return (tty_ioctl(tp, TIOCCONS, (caddr_t)&one, fflag, td)); + } default: return (ENOIOCTL);