diff options
author | tanimura <tanimura@FreeBSD.org> | 2005-10-08 11:03:29 +0000 |
---|---|---|
committer | tanimura <tanimura@FreeBSD.org> | 2005-10-08 11:03:29 +0000 |
commit | 105781c4880e48a6ff6444f77d5e1c631cb97e8e (patch) | |
tree | b015ae30ad7966b435144f2ceb0dfa49249a1f80 /sys/netgraph/ng_tty.c | |
parent | 40a15ca539efbe34b1028647e53c7be319ab6d57 (diff) | |
download | FreeBSD-src-105781c4880e48a6ff6444f77d5e1c631cb97e8e.zip FreeBSD-src-105781c4880e48a6ff6444f77d5e1c631cb97e8e.tar.gz |
In ngt_input(), do not derefer sc (= (sc_p) tp->t_lsc) before making
sure sc != NULL.
Diffstat (limited to 'sys/netgraph/ng_tty.c')
-rw-r--r-- | sys/netgraph/ng_tty.c | 7 |
1 files changed, 5 insertions, 2 deletions
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"); |