Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site bpa.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittatc!dcdwest!sdcsvax!sdcrdcf!burdvax!bpa!espo From: espo@bpa.UUCP (Bob Esposito) Newsgroups: net.unix-wizards Subject: SystemV fix for tty.c Message-ID: <295@bpa.UUCP> Date: Sun, 2-Feb-86 12:36:27 EST Article-I.D.: bpa.295 Posted: Sun Feb 2 12:36:27 1986 Date-Received: Wed, 5-Feb-86 00:49:50 EST Distribution: net.unix Organization: Wayne, Pennsylvania Lines: 44 Here's my fix for the protection violation trap on a VAX in tty.c Bob Esposito ... bpa!espo ***** tty.c /* * common ioctl tty code */ ttiocom(tp, cmd, arg, mode) register struct tty *tp; { register flag; struct termio cb; struct sgttyb tb; + extern nulldev(); switch(cmd) { ------------------------------------------ case TCSETA: if (copyin(arg, &cb, sizeof cb)) { u.u_error = EFAULT; break; } if (tp->t_line != cb.c_line) { if (cb.c_line < 0 || cb.c_line >= linecnt) { u.u_error = EINVAL; break; } + if (linesw[cb.c_line].l_ioctl == nulldev) { + u.u_error = EINVAL; + break; + } (*linesw[tp->t_line].l_ioctl)(tp, LDCLOSE, 0, mode); }