From 5e257861c88947a4605a99a419658f32473aa27c Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 15 Jul 2008 16:13:43 -0400 Subject: In openvz we found out some interfaces may return a null pointer here. Skip them if no address is provided or we later get a segfault because we dereference a null pointer. --- ipa-server/ipa-kpasswd/ipa_kpasswd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ipa-server/ipa-kpasswd/ipa_kpasswd.c b/ipa-server/ipa-kpasswd/ipa_kpasswd.c index 72d3c13d..0300a3e9 100644 --- a/ipa-server/ipa-kpasswd/ipa_kpasswd.c +++ b/ipa-server/ipa-kpasswd/ipa_kpasswd.c @@ -1296,6 +1296,10 @@ int main(int argc, char *argv[]) for (tifa = ifa; tifa; tifa = tifa->ifa_next) { + if (NULL == tifa->ifa_addr) + /* uhmm no address ?? skip it */ + continue; + if (tifa->ifa_addr->sa_family != AF_INET && tifa->ifa_addr->sa_family != AF_INET6) { /* not interesting for us */ -- cgit