problem with ldap search using c

hi all

i m writin a c program to search ldap db for values.
i used the following code after search result return a value >0

if (result==1)
{
entry=ldap_first_entry(ld,msg);
for(....;....;...)
{
// code to store the data values
}
}

i m gettin an error at the highlighted statement.

the error msg is ...../....../..../libraries/libldap/getentry.c:36: ldap_first_entry: Assertion 'chain !=(( void *)0)' failed.

can ny body help with this????

That most probably sounds like your LDAP distribution has bugs, or bugs introduced on compilation (incompatible compilers, etc.) when the variable that should not be null becomes null.

Try upgrading or downgrading your LDAP libraries and see if that fixes the problem.