mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
[BZ #1254]
2005-10-22 Roland McGrath <roland@redhat.com> [BZ #1254] * sysdeps/mach/hurd/getpeername.c (__getpeername): Fix last change. From Samuel Thibault <samuel.thibault@ens-lyon.org>.
This commit is contained in:
parent
d8f5ccdde7
commit
2ba7a64cb9
@ -1,3 +1,9 @@
|
||||
2005-10-22 Roland McGrath <roland@redhat.com>
|
||||
|
||||
[BZ #1254]
|
||||
* sysdeps/mach/hurd/getpeername.c (__getpeername): Fix last change.
|
||||
From Samuel Thibault <samuel.thibault@ens-lyon.org>.
|
||||
|
||||
2005-10-17 Thomas Schwinge <tschwinge@gnu.org>
|
||||
|
||||
[BZ #1252]
|
||||
|
@ -55,11 +55,14 @@ __getpeername (int fd, __SOCKADDR_ARG addrarg, socklen_t *len)
|
||||
}
|
||||
|
||||
const sa_family_t family = type;
|
||||
if (*len < (char *) (&addr->sa_family + 1) - (char *) addr)
|
||||
memcpy (&addr->sa_family, &family,
|
||||
*len - offsetof (struct sockaddr, sa_family));
|
||||
else
|
||||
addr->sa_family = family;
|
||||
if (*len > offsetof (struct sockaddr, sa_family))
|
||||
{
|
||||
if (*len < (char *) (&addr->sa_family + 1) - (char *) addr)
|
||||
memcpy (&addr->sa_family, &family,
|
||||
*len - offsetof (struct sockaddr, sa_family));
|
||||
else
|
||||
addr->sa_family = family;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user