forked from pool/libtirpc
Dirk Mueller
74e28149ed
Prevent a segfault of 'rpcinfo -b' on systems with tuntap devices (bnc#861577). Added: libtirpc-getbroadifs-crash.patch OBS-URL: https://build.opensuse.org/request/show/220501 OBS-URL: https://build.opensuse.org/package/show/Base:System/libtirpc?expand=0&rev=39
34 lines
1.1 KiB
Diff
34 lines
1.1 KiB
Diff
From 5aa9bf181ec1ce900ca4e84c62e3b31346478626 Mon Sep 17 00:00:00 2001
|
|
From: Olaf Kirch <okir@suse.de>
|
|
Date: Fri, 31 Jan 2014 16:37:25 +0100
|
|
Subject: [PATCH] Prevent a segfault of "rpcinfo -b" on systems with tuntap
|
|
devices
|
|
|
|
Linux tuntap devices and other virtual network devices, if not
|
|
configured, will be reported by getifaddrs() with a NULL ifa_addr
|
|
pointer. __rpc_getifaddrs would trip over that, because it derefenced
|
|
the ifa_addr pointer without checking.
|
|
|
|
Signed-off-by: Olaf Kirch <okir@suse.de>
|
|
---
|
|
src/clnt_bcast.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/clnt_bcast.c b/src/clnt_bcast.c
|
|
index 1055545..6ab0851 100644
|
|
--- a/src/clnt_bcast.c
|
|
+++ b/src/clnt_bcast.c
|
|
@@ -143,7 +143,8 @@ __rpc_getbroadifs(int af, int proto, int socktype, broadlist_t *list)
|
|
return 0;
|
|
|
|
for (ifap = ifp; ifap != NULL; ifap = ifap->ifa_next) {
|
|
- if (ifap->ifa_addr->sa_family != af ||
|
|
+ if (ifap->ifa_addr == NULL || /* happens for eg tuntap devices */
|
|
+ ifap->ifa_addr->sa_family != af ||
|
|
!(ifap->ifa_flags & IFF_UP))
|
|
continue;
|
|
bip = (struct broadif *)malloc(sizeof *bip);
|
|
--
|
|
1.7.12.4
|
|
|