https://bugs.openldap.org/show_bug.cgi?id=9803
--- Comment #7 from jengelh@inai.de jengelh@inai.de --- (In reply to Ondřej Kuzník from comment #6)
Are you sure the server is responding with a valid LDAP message?
Not at all. It's some Novell eDirectory, and for all I know, it could be sending junk every now and then due bugs of its own.
If that's the case, you can check that putting ber_free( ber, 1 ); lc->lconn_ber = NULL; at that point should make the assert go away.
Looks good so far, I have not seen SIGABRT occurring in a while with these two lines.