In tcp6_usr_attach(), return immediately if SS_ISDISCONNECTED, to

avoid dereferencing an uninitialized inp variable.

Submitted by:	Michiel Boland <michiel at boland dot org>
MFC after:	1 month
This commit is contained in:
Robert Watson 2006-06-26 09:38:08 +00:00
parent 8ca0124685
commit b4470c1639

View File

@ -647,10 +647,8 @@ tcp6_usr_accept(struct socket *so, struct sockaddr **nam)
int v4 = 0;
TCPDEBUG0;
if (so->so_state & SS_ISDISCONNECTED) {
error = ECONNABORTED;
goto out;
}
if (so->so_state & SS_ISDISCONNECTED)
return (ECONNABORTED);
inp = sotoinpcb(so);
KASSERT(inp != NULL, ("tcp6_usr_accept: inp == NULL"));