Exception handling!!!

"Pratima Shet" <[email protected]> Wed, 21 Apr 2010 11:39:31 +0530
Newsgroups gmane.network.openldap.general
Message-ID <9D5E1752379A43408015F7FE984661150808D6CF@CHNEXVS01.VSNLXCHANGE.COM>
Hi,
Sorry for insufficient information.
In brief,am trying to connect to LDAP server using following api's
 
res = ldap_initialize(&ld, ldapuri);
res = ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &protocol );
res = ldap_start_tls_s(ld, NULL, NULL);
res = ldap_sasl_interactive_bind_s( ld, NULL, "NTLM", NULL, NULL,sasl_flags, saslInteract, &auth );

My code normally  works fine, but in one senario after TLS, it crashed inside ldap_sasl_interactive_bind_s()
API. 
Crash report says it crashed in "ber_sockbuf_ctrl + 147" inside "liblber" library.
I think, it is possible to avoid the crash, If I could catch exceptions from library.

Any idea?
Thanks and regards,
Pratima