Cygwin: AF_UNIX: accept4: copy trailing NUL byte
If the caller has requested the peer's address, include the trailing NUL byte of the address if possible.
This commit is contained in:
parent
a0dd60f857
commit
0f800bf44a
|
@ -1665,7 +1665,7 @@ fhandler_socket_unix::accept4 (struct sockaddr *peer, int *len, int flags)
|
|||
if (sun)
|
||||
{
|
||||
memcpy (peer, &sun->un,
|
||||
MIN (*len, sun->un_len));
|
||||
MIN (*len, sun->un_len + 1));
|
||||
*len = sun->un_len;
|
||||
}
|
||||
else if (len)
|
||||
|
|
Loading…
Reference in New Issue