rb_inet_pton_sock: initialise sockaddr to zero

This commit is contained in:
Simon Arlott 2017-08-23 21:14:29 +01:00
parent 365e13662e
commit 9caecc9348
No known key found for this signature in database
GPG key ID: C8975F2043CA5D24

View file

@ -1307,6 +1307,7 @@ inet_ntop6(const unsigned char *src, char *dst, unsigned int size)
int
rb_inet_pton_sock(const char *src, struct sockaddr *dst)
{
memset(dst, 0, sizeof(*dst));
if(rb_inet_pton(AF_INET, src, &((struct sockaddr_in *)dst)->sin_addr))
{
SET_SS_FAMILY(dst, AF_INET);