cb4f0cb Ticket #47948 - ldap_sasl_bind fails assertion (ld != NULL) if it is called from chainingdb_bind over SSL/startTLS

Authored and Committed by nhosoi 7 years ago
    Ticket #47948 - ldap_sasl_bind fails assertion (ld != NULL) if it is called from chainingdb_bind over SSL/startTLS
    
    Bug Description: In case startTLS, if ldap_start_tls_s called from
    cb_get_connection failed and it returned non LDAP_SUCCESS return
    code, the code was stored in the local variable just in the error
    case, used only for error logging and abandoned in the scope; the
    caller cb_get_connection returned LDAP_SUCCESS even if the connection
    was not established.  That confuses the caller of cb_get_connection
    and let it call ldap_sasl_bind with NULL ld and it causes the assertion
    failure.
    
    Fix Description: remove the local variable declaration in the scope.
    
    https://fedorahosted.org/389/ticket/47948
    
    Reviewed by rmeggins@redhat.com (Thank you, Rich!!)
    
    (cherry picked from commit 47868d3e5278d425abe5e8325f2965de66c10cff)