If we don't zero the struct sockaddrs in fai_add_entry() then any sin_zero
fields will be left as random memory and the memcmp() will return that the
addresses are different even if they aren't.
ticket: new
target_version: 1.6.1
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19235
dc483132-0cff-0310-8789-
dd5450dbe970
sin4 = malloc (sizeof (struct sockaddr_in));
if (sin4 == 0)
return EAI_MEMORY;
+ memset (sin4, 0, sizeof (struct sockaddr_in)); /* for sin_zero */
n->ai_addr = (struct sockaddr *) sin4;
sin4->sin_family = AF_INET;
sin4->sin_addr = *(struct in_addr *)addr;
sin6 = malloc (sizeof (struct sockaddr_in6));
if (sin6 == 0)
return EAI_MEMORY;
+ memset (sin6, 0, sizeof (struct sockaddr_in6)); /* for sin_zero */
n->ai_addr = (struct sockaddr *) sin6;
sin6->sin6_family = AF_INET6;
sin6->sin6_addr = *(struct in6_addr *)addr;