summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2008-07-15 16:13:43 -0400
committerSimo Sorce <ssorce@redhat.com>2008-07-15 16:16:33 -0400
commit67f62709f83997945b69919cd744ce936ddf5596 (patch)
tree54fe592fd5d70b22801af5113990cac1abb9e9bf
parent4b4e0e151687621f552ababab7bb960c59e3de86 (diff)
downloadfreeipa-67f62709f83997945b69919cd744ce936ddf5596.tar.gz
freeipa-67f62709f83997945b69919cd744ce936ddf5596.tar.xz
freeipa-67f62709f83997945b69919cd744ce936ddf5596.zip
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.
-rw-r--r--ipa-server/ipa-kpasswd/ipa_kpasswd.c4
1 files changed, 4 insertions, 0 deletions
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 */