From: Howard Chu Date: Mon, 8 Feb 2021 00:57:28 +0000 (+0000) Subject: ITS#9458 fix connection_init failure reset X-Git-Tag: OPENLDAP_REL_ENG_2_4_58~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6258b6c825fc6f3e686750eb09ee2b197941073;p=thirdparty%2Fopenldap.git ITS#9458 fix connection_init failure reset --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 44c3fc63df..0c7d4c54b1 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -553,8 +553,15 @@ Connection * connection_init( BER_BVZERO( &c->c_peer_name ); ber_sockbuf_free( c->c_sb ); - c->c_sb = NULL; + c->c_sb = ber_sockbuf_alloc( ); + { + ber_len_t max = sockbuf_max_incoming; + ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_SET_MAX_INCOMING, &max ); + } + c->c_sd = AC_SOCKET_INVALID; + c->c_conn_state = SLAP_C_INVALID; + c->c_struct_state = SLAP_C_UNUSED; ldap_pvt_thread_mutex_unlock( &c->c_mutex ); return NULL;