forked from pool/libtirpc
33 lines
1.1 KiB
Diff
33 lines
1.1 KiB
Diff
From 95c8f7227e6b15f2e430d7b87dadc95b2acd4a61 Mon Sep 17 00:00:00 2001
|
|
From: Olaf Kirch <okir@suse.de>
|
|
Date: Tue, 2 Sep 2008 12:09:39 -0400
|
|
Subject: [PATCH] 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>
|
|
---
|
|
src/clnt_bcast.c | 2 +-
|
|
1 files changed, 1 insertions(+), 1 deletions(-)
|
|
|
|
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 *)
|
|
--
|
|
1.5.6
|
|
|