about summary refs log tree commit diff
path: root/resolv/res_send.c
diff options
context:
space:
mode:
Diffstat (limited to 'resolv/res_send.c')
-rw-r--r--resolv/res_send.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/resolv/res_send.c b/resolv/res_send.c
index 27dd1d4351..23306a2fb4 100644
--- a/resolv/res_send.c
+++ b/resolv/res_send.c
@@ -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++;
 			}