summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_subr.c
diff options
context:
space:
mode:
authorhsu <hsu@FreeBSD.org>2002-12-24 21:00:31 +0000
committerhsu <hsu@FreeBSD.org>2002-12-24 21:00:31 +0000
commit449c7cf2ec0ef490d47057b98cac0fbdfe2f71d9 (patch)
tree66f5a3c92b8353f9df0e551a9cfdf2bb7d046259 /sys/netinet/tcp_subr.c
parentd52d1ebbebd2c94b5d0979363463f75358f763e1 (diff)
downloadFreeBSD-src-449c7cf2ec0ef490d47057b98cac0fbdfe2f71d9.zip
FreeBSD-src-449c7cf2ec0ef490d47057b98cac0fbdfe2f71d9.tar.gz
Validate inp to prevent an use after free.
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r--sys/netinet/tcp_subr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
index 845df42..46e32d9 100644
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -771,6 +771,7 @@ tcp_close(tp)
FREE(q, M_TSEGQ);
}
inp->inp_ppcb = NULL;
+ tp->t_inpcb = NULL;
soisdisconnected(so);
#ifdef INET6
if (INP_CHECK_SOCKAF(so, AF_INET6))
@@ -1427,7 +1428,7 @@ tcp_mtudisc(inp, errno)
/*
* Look-up the routing entry to the peer of this inpcb. If no route
- * is found and it cannot be allocated the return NULL. This routine
+ * is found and it cannot be allocated, then return NULL. This routine
* is called by TCP routines that access the rmx structure and by tcp_mss
* to get the interface MTU.
*/
OpenPOWER on IntegriCloud