The attributes list passed to ldap_search must be terminated by a NULL
pointer. That wasn't the case in sarg and was likely responsible for a
segfault. It should be fixed now.
int i;
int slen;
int rc;
- char *attrs[1];
+ char *attrs[2];
searched_in_cache = search_in_cache(userlogin);
if (searched_in_cache!=NULL) {
/* Search record(s) in LDAP base */
attrs[0]=LDAPTargetAttr;
+ attrs[1]=NULL;
rc= ldap_search_ext_s(ldap_handle, LDAPBaseSearch, LDAP_SCOPE_SUBTREE, filtersearch, attrs, 0, NULL, NULL, NULL, -1, &result);
if (rc != LDAP_SUCCESS) {
debuga(_("LDAP search failed: %s\n"), ldap_err2string(rc));