Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 211405
b: refs/heads/master
c: d7e0d19
h: refs/heads/master
i:
  211403: e6ebe6b
v: v3
  • Loading branch information
Dan Rosenberg authored and David S. Miller committed Oct 4, 2010
1 parent 66be245 commit cecfcd3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5b7c84066733c5dfb0e4016d939757b38de189e4
refs/heads/master: d7e0d19aa0fdd22819d35db551bd54c1bcf9c2aa
13 changes: 12 additions & 1 deletion trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,11 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
/* Walk through the addrs buffer and count the number of addresses. */
addr_buf = kaddrs;
while (walk_size < addrs_size) {
if (walk_size + sizeof(sa_family_t) > addrs_size) {
kfree(kaddrs);
return -EINVAL;
}

sa_addr = (struct sockaddr *)addr_buf;
af = sctp_get_af_specific(sa_addr->sa_family);

Expand Down Expand Up @@ -1002,9 +1007,13 @@ static int __sctp_connect(struct sock* sk,
/* Walk through the addrs buffer and count the number of addresses. */
addr_buf = kaddrs;
while (walk_size < addrs_size) {
if (walk_size + sizeof(sa_family_t) > addrs_size) {
err = -EINVAL;
goto out_free;
}

sa_addr = (union sctp_addr *)addr_buf;
af = sctp_get_af_specific(sa_addr->sa.sa_family);
port = ntohs(sa_addr->v4.sin_port);

/* If the address family is not supported or if this address
* causes the address buffer to overflow return EINVAL.
Expand All @@ -1014,6 +1023,8 @@ static int __sctp_connect(struct sock* sk,
goto out_free;
}

port = ntohs(sa_addr->v4.sin_port);

/* Save current address so we can work with it */
memcpy(&to, sa_addr, af->sockaddr_len);

Expand Down

0 comments on commit cecfcd3

Please sign in to comment.