From 67f62709f83997945b69919cd744ce936ddf5596 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 15 Jul 2008 16:13:43 -0400 Subject: [PATCH] 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 7b4f39ea2..43ca223d5 100644 --- a/ipa-server/ipa-kpasswd/ipa_kpasswd.c +++ b/ipa-server/ipa-kpasswd/ipa_kpasswd.c @@ -1299,6 +1299,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 */