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 <mbabinsk@redhat.com>
This commit is contained in:
Tomas Babej 2016-01-26 17:32:29 +01:00
parent e668b06231
commit d53c2f6b80

View File

@ -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) {