[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: program segfaults on ldap_get_values/ldap_get_values_len



On Sat, 8 Mar 2008, Brian Hechinger wrote:
...
I can bind without issue, but I need to retrieve the values held by a
specific multi valued attribute, and that's where I'm having issues.

I was using ldap_get_values() and all the other deprecated functions, but
have recently converted my code to only use what's available in 2.4.x

Sadly, that didn't fix the problem, it still happens.

This line:

attr_values = ldap_get_values_len(ldap_conn, entry, attr);

Segfaults with SIGABRT and prints this to stderr:

Assertion failed: (LBER_VALID( ber )), function ber_scanf, file decode.c, line 779.

You passed an invalid 'entry' value to ldap_get_values_len(). Where did that value come from? (i.e., what's the code that leads up to that call?) Presumably there was a search that ended with an ldap_result() call. What sort of checking of the result of ldap_result() did you perform to handle errors and timeouts?



Philip Guenther