(__libc_res_nsend): Initialize all of the memory allocated for the
authordrepper <drepper>
Wed, 22 Aug 2007 04:02:38 +0000 (04:02 +0000)
committerdrepper <drepper>
Wed, 22 Aug 2007 04:02:38 +0000 (04:02 +0000)
name server address.

resolv/res_send.c

index 27dd1d4..23306a2 100644 (file)
@@ -425,9 +425,12 @@ __libc_res_nsend(res_state statp, const u_char *buf, int buflen,
                                EXT(statp).nsaddrs[n] =
                                    malloc(sizeof (struct sockaddr_in6));
                        if (EXT(statp).nsaddrs[n] != NULL) {
-                               memcpy(EXT(statp).nsaddrs[n],
-                                      &statp->nsaddr_list[ns],
-                                      sizeof (struct sockaddr_in));
+                               memset (mempcpy(EXT(statp).nsaddrs[n],
+                                               &statp->nsaddr_list[ns],
+                                               sizeof (struct sockaddr_in)),
+                                       '\0',
+                                       sizeof (struct sockaddr_in6)
+                                       - sizeof (struct sockaddr_in));
                                EXT(statp).nssocks[n] = -1;
                                n++;
                        }