libtirpc/libtirpc-0.1.9-rpc_getbroadifs-sizeof.patch
Steve Dickson 66af2ac9a7 - Always make IPv6 sockets V6ONLY
- Fix incorrect sizeof() in __rpc_getbroadifs
2008-09-04 18:18:22 +00:00

28 lines
1.0 KiB
Diff

commit 95c8f7227e6b15f2e430d7b87dadc95b2acd4a61
Author: Olaf Kirch <okir@suse.de>
Date: Tue Sep 2 12:09:39 2008 -0400
Fix incorrect sizeof() in __rpc_getbroadifs
__rpc_getbroadifs returns bad broadcast addresses on 32bit
machines because when copying the broadcast addresses, ite
applies the sizeof() operator to a pointer to a sockaddr,
rather than the sockaddr itself.
Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Steve Dickson <steved@redhat.com>
diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c
index a96db45..aa2b8f2 100644
--- a/src/clnt_bcast.c
+++ b/src/clnt_bcast.c
@@ -163,7 +163,7 @@ __rpc_getbroadifs(int af, int proto, int socktype, broadlist_t *list)
/* memcpy(&bip->broadaddr, ifap->ifa_broadaddr,
(size_t)ifap->ifa_broadaddr->sa_len);*/
memcpy(&bip->broadaddr, ifap->ifa_broadaddr,
- (size_t)sizeof(ifap->ifa_broadaddr));
+ sizeof(bip->broadaddr));
sin = (struct sockaddr_in *)(void *)&bip->broadaddr;
sin->sin_port =
((struct sockaddr_in *)