summaryrefslogtreecommitdiff
path: root/net/tipc
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2006-06-25 23:44:27 -0700
committerDavid S. Miller <davem@davemloft.net>2006-06-25 23:44:27 -0700
commit6b384de853c9f05e5e6da6c95edb475b96dd2cc1 (patch)
treeb9b26a5c1c41153eb2557480910339576583ffa6 /net/tipc
parente9024f0f79c3f847a793d6a16bf4fefc6d7a4649 (diff)
downloadlinux-3.10-6b384de853c9f05e5e6da6c95edb475b96dd2cc1.tar.gz
linux-3.10-6b384de853c9f05e5e6da6c95edb475b96dd2cc1.tar.bz2
linux-3.10-6b384de853c9f05e5e6da6c95edb475b96dd2cc1.zip
[TIPC]: Fixed connect() to detect a dest address that is missing or too short.
Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Per Liden <per.liden@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 0923213fc6a..758b2d2d2f9 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -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;