summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_socket.c
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <luiz@netgate.com>2016-06-30 13:24:42 -0500
committerLuiz Otavio O Souza <luiz@netgate.com>2016-06-30 13:24:42 -0500
commit9d5ffb47ff56597309eb2939cc97b1df4d616797 (patch)
treeb34fd92dce8092bb4cb58c875caabd93e1fece39 /sys/compat/linux/linux_socket.c
parent1fc6b0207cc2f3cce33817706603caa41a9de24d (diff)
parent13295f52fb5936b237a994e75311fe18612c73c4 (diff)
downloadFreeBSD-src-9d5ffb47ff56597309eb2939cc97b1df4d616797.zip
FreeBSD-src-9d5ffb47ff56597309eb2939cc97b1df4d616797.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'sys/compat/linux/linux_socket.c')
-rw-r--r--sys/compat/linux/linux_socket.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index bc543c7..e340873 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -1040,18 +1040,16 @@ linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args)
{
struct msghdr msg;
struct iovec aiov;
- int error;
+ int error, fromlen;
if (PTRIN(args->fromlen) != NULL) {
- error = copyin(PTRIN(args->fromlen), &msg.msg_namelen,
- sizeof(msg.msg_namelen));
- if (error != 0)
- return (error);
-
- error = linux_to_bsd_sockaddr((struct sockaddr *)PTRIN(args->from),
- msg.msg_namelen);
+ error = copyin(PTRIN(args->fromlen), &fromlen,
+ sizeof(fromlen));
if (error != 0)
return (error);
+ if (fromlen < 0)
+ return (EINVAL);
+ msg.msg_namelen = fromlen;
} else
msg.msg_namelen = 0;
OpenPOWER on IntegriCloud