From 9a8f44c09e0e78550b126235240214e7b11af081 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Wed, 19 Feb 2014 23:24:29 +0200 Subject: libotp: do not call internal search for NULL dn Reviewed-By: Nathaniel McCallum --- daemons/ipa-slapi-plugins/libotp/libotp.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/daemons/ipa-slapi-plugins/libotp/libotp.c b/daemons/ipa-slapi-plugins/libotp/libotp.c index 31cc5915..e6c8eaad 100644 --- a/daemons/ipa-slapi-plugins/libotp/libotp.c +++ b/daemons/ipa-slapi-plugins/libotp/libotp.c @@ -332,6 +332,7 @@ static struct otptoken **find(Slapi_ComponentId *id, const char *user_dn, Slapi_PBlock *pb = NULL; Slapi_DN *sdn = NULL; char *filter = NULL; + const char *basedn = NULL; size_t count = 0; int result = -1; @@ -362,8 +363,12 @@ static struct otptoken **find(Slapi_ComponentId *id, const char *user_dn, if (sdn == NULL) goto error; + basedn = get_basedn(sdn); + if (basedn == NULL) + goto error; + /* Find all user tokens. */ - slapi_search_internal_set_pb(pb, get_basedn(sdn), + slapi_search_internal_set_pb(pb, basedn, LDAP_SCOPE_SUBTREE, filter, NULL, 0, NULL, NULL, id, 0); } -- cgit