From 5f97b735549f9ff9719a64074da4282872e23156 Mon Sep 17 00:00:00 2001 From: Yannick CANN Date: Thu, 6 Oct 2016 15:40:47 +0200 Subject: [PATCH] ldap: Fix crash in case of empty LDAP response for CRL fetch In case of an empty LDAP result during a CRL fetch (for example, due to a wrong filter attribute in the LDAP URI, or invalid LDAP configuration), the call to ldap_result2error() with NULL value for "entry" lead to a crash. Closes strongswan/strongswan#52. --- src/libstrongswan/plugins/ldap/ldap_fetcher.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libstrongswan/plugins/ldap/ldap_fetcher.c b/src/libstrongswan/plugins/ldap/ldap_fetcher.c index fe4c55545..635d5fc0e 100644 --- a/src/libstrongswan/plugins/ldap/ldap_fetcher.c +++ b/src/libstrongswan/plugins/ldap/ldap_fetcher.c @@ -93,8 +93,7 @@ static bool parse(LDAP *ldap, LDAPMessage *result, chunk_t *response) } else { - DBG1(DBG_LIB, "finding first LDAP entry failed: %s", - ldap_err2string(ldap_result2error(ldap, entry, 0))); + DBG1(DBG_LIB, "finding first LDAP entry failed"); } return success; }