summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2016-01-26 17:32:29 +0100
committerTomas Babej <tbabej@redhat.com>2016-01-27 17:08:57 +0100
commitd53c2f6b806335507ffd5e78be42471b85a39bbf (patch)
tree5997d4450253bcbe8eee91b5e430a89e01c230d8 /client
parente668b06231553457df64eb43bef8918b21b4ebdc (diff)
downloadfreeipa-d53c2f6b806335507ffd5e78be42471b85a39bbf.tar.gz
freeipa-d53c2f6b806335507ffd5e78be42471b85a39bbf.tar.xz
freeipa-d53c2f6b806335507ffd5e78be42471b85a39bbf.zip
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>
Diffstat (limited to 'client')
-rw-r--r--client/ipa-getkeytab.c4
1 files changed, 4 insertions, 0 deletions
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) {