From 105781c4880e48a6ff6444f77d5e1c631cb97e8e Mon Sep 17 00:00:00 2001 From: tanimura Date: Sat, 8 Oct 2005 11:03:29 +0000 Subject: In ngt_input(), do not derefer sc (= (sc_p) tp->t_lsc) before making sure sc != NULL. --- sys/netgraph/ng_tty.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sys/netgraph/ng_tty.c') diff --git a/sys/netgraph/ng_tty.c b/sys/netgraph/ng_tty.c index d9a6849..380bcdf 100644 --- a/sys/netgraph/ng_tty.c +++ b/sys/netgraph/ng_tty.c @@ -331,15 +331,18 @@ ngt_tioctl(struct tty *tp, u_long cmd, caddr_t data, int flag, struct thread *td static int ngt_input(int c, struct tty *tp) { - const sc_p sc = (sc_p) tp->t_lsc; - const node_p node = sc->node; + sc_p sc; + node_p node; struct mbuf *m; int error = 0; + sc = (sc_p) tp->t_lsc; if (sc == NULL) /* No node attached */ return (0); + node = sc->node; + if (tp != sc->tp) panic("ngt_input"); -- cgit v1.1