Commit 6b384de8 authored by Allan Stephens's avatar Allan Stephens Committed by David S. Miller
Browse files

[TIPC]: Fixed connect() to detect a dest address that is missing or too short.

parent e9024f0f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1244,7 +1244,7 @@ static int connect(struct socket *sock, struct sockaddr *dest, int destlen,
   if (sock->state != SS_UNCONNECTED)
           return -EISCONN;

   if ((dst->family != AF_TIPC) ||
   if ((destlen < sizeof(*dst)) || (dst->family != AF_TIPC) ||
       ((dst->addrtype != TIPC_ADDR_NAME) && (dst->addrtype != TIPC_ADDR_ID)))
           return -EINVAL;