Lock unp2 after checking for a non-NULL unp2 pointer in uipc_send() on
datagram UNIX domain sockets, not before.
This commit is contained in:
parent
7b6b0e6d24
commit
3592fd4de5
@ -800,11 +800,11 @@ uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
|
||||
* correct error that the socket is not connected.
|
||||
*/
|
||||
UNP_PCB_LOCK_ASSERT(unp);
|
||||
UNP_PCB_LOCK(unp2);
|
||||
if (unp2 == NULL) {
|
||||
error = ENOTCONN;
|
||||
break;
|
||||
}
|
||||
UNP_PCB_LOCK(unp2);
|
||||
so2 = unp2->unp_socket;
|
||||
if (unp->unp_addr != NULL)
|
||||
from = (struct sockaddr *)unp->unp_addr;
|
||||
|
Loading…
Reference in New Issue
Block a user