From d53c2f6b806335507ffd5e78be42471b85a39bbf Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Tue, 26 Jan 2016 17:32:29 +0100 Subject: ipa-getkeytab: Handle the possibility of not obtaining a result The ldap_result operation can time out, returning a NULL result, which in turn causes the parsing operation to crash. https://fedorahosted.org/freeipa/ticket/5642 Reviewed-By: Martin Babinsky --- client/ipa-getkeytab.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/ipa-getkeytab.c b/client/ipa-getkeytab.c index 3592d9970..d49258653 100644 --- a/client/ipa-getkeytab.c +++ b/client/ipa-getkeytab.c @@ -275,6 +275,10 @@ static int ipa_ldap_extended_op(LDAP *ld, const char *reqoid, fprintf(stderr, _("Failed to get result: %s\n"), ldap_err2string(ret)); goto done; } + else if (res == NULL) { + fprintf(stderr, _("Timeout exceeded.")); + goto done; + } ret = ldap_parse_extended_result(ld, res, &retoid, &retdata, 0); if (ret != LDAP_SUCCESS) { -- cgit