]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9176 check for failure setting SNI
authorHoward Chu <hyc@openldap.org>
Mon, 27 Apr 2020 17:54:02 +0000 (18:54 +0100)
committerHoward Chu <hyc@openldap.org>
Mon, 27 Apr 2020 17:54:02 +0000 (18:54 +0100)
libraries/libldap/tls_o.c

index 196134f6f41ba96b377bc713977a67f10f80513c..e6f83c795dd5e1244a800cf56d7e061f219845c1 100644 (file)
@@ -531,7 +531,9 @@ tlso_session_connect( LDAP *ld, tls_session *sess, const char *name_in )
 
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
        if ( name_in ) {
-               SSL_set_tlsext_host_name( s, name_in );
+               rc = SSL_set_tlsext_host_name( s, name_in );
+               if ( !rc )              /* can fail to strdup the name */
+                       return -1;
        }
 #endif
        /* Caller expects 0 = success, OpenSSL returns 1 = success */