Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263513
b: refs/heads/master
c: bc909d9
h: refs/heads/master
i:
  263511: 141fd37
v: v3
  • Loading branch information
Mathieu Desnoyers authored and David S. Miller committed Aug 25, 2011
1 parent 8c655af commit 89d7d83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 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: c6f59d13e24187ff95427a9f4a5a7e14fb8faf5a
refs/heads/master: bc909d9ddbf7778371e36a651d6e4194b1cc7d4c
10 changes: 6 additions & 4 deletions trunk/net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1965,8 +1965,9 @@ static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
* used_address->name_len is initialized to UINT_MAX so that the first
* destination address never matches.
*/
if (used_address && used_address->name_len == msg_sys->msg_namelen &&
!memcmp(&used_address->name, msg->msg_name,
if (used_address && msg_sys->msg_name &&
used_address->name_len == msg_sys->msg_namelen &&
!memcmp(&used_address->name, msg_sys->msg_name,
used_address->name_len)) {
err = sock_sendmsg_nosec(sock, msg_sys, total_len);
goto out_freectl;
Expand All @@ -1978,8 +1979,9 @@ static int __sys_sendmsg(struct socket *sock, struct msghdr __user *msg,
*/
if (used_address && err >= 0) {
used_address->name_len = msg_sys->msg_namelen;
memcpy(&used_address->name, msg->msg_name,
used_address->name_len);
if (msg_sys->msg_name)
memcpy(&used_address->name, msg_sys->msg_name,
used_address->name_len);
}

out_freectl:
Expand Down

0 comments on commit 89d7d83

Please sign in to comment.