g_inet_socket_address_to_native: properly zero out sockaddr_in6

This commit is contained in:
Dan Winship 2009-08-17 13:20:49 -04:00
parent aa5293612f
commit 8f6d26e964

View File

@ -200,7 +200,7 @@ g_inet_socket_address_to_native (GSocketAddress *address,
return FALSE;
}
memset (sock, 0, sizeof (sock));
memset (sock, 0, sizeof (*sock));
sock->sin6_family = AF_INET6;
sock->sin6_port = g_htons (addr->priv->port);
memcpy (&(sock->sin6_addr.s6_addr), g_inet_address_to_bytes (addr->priv->address), sizeof (sock->sin6_addr));