diff options
Diffstat (limited to 'sysdeps/mach/hurd/recvmsg.c')
-rw-r--r-- | sysdeps/mach/hurd/recvmsg.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/recvmsg.c b/sysdeps/mach/hurd/recvmsg.c index 99aee121f7..93acbff642 100644 --- a/sysdeps/mach/hurd/recvmsg.c +++ b/sysdeps/mach/hurd/recvmsg.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2016 Free Software Foundation, Inc. +/* Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -85,7 +85,7 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags) &message->msg_flags, amount))) return __hurd_sockfail (fd, flags, err); - if (message->msg_name != NULL) + if (message->msg_name != NULL && aport != MACH_PORT_NULL) { char *buf = message->msg_name; mach_msg_type_number_t buflen = message->msg_namelen; @@ -119,6 +119,8 @@ __libc_recvmsg (int fd, struct msghdr *message, int flags) if (buflen > 0) ((struct sockaddr *) message->msg_name)->sa_family = type; } + else if (message->msg_name != NULL) + message->msg_namelen = 0; __mach_port_deallocate (__mach_task_self (), aport); |