From: Kurt Zeilenga Date: Sat, 28 Aug 1999 06:15:43 +0000 (+0000) Subject: Fix *=+=* bug. X-Git-Tag: OPENLDAP_REL_ENG_1_2_7~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9de09b1d016de2a34069d5b1d019b6bfb07510c;p=thirdparty%2Fopenldap.git Fix *=+=* bug. Plug leak of ber. --- diff --git a/CHANGES b/CHANGES index 9d2c544c85..108b926aa4 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ Changes included in OpenLDAP 1.2 Release Engineering Fixed slapd memory leaks (ITS#249 ITS#250) Fixed test005-modrdn to properly report failure in delete rdn case Fixed ldapsearch (%s) bug (ITS#274) + Fixed slapd (cn=*=+=*) regex bug (ITS#272) Build environment Disable config.cache to ensure consistent detection Documentation diff --git a/servers/slapd/filterentry.c b/servers/slapd/filterentry.c index a6528b2877..4afa5ed4d2 100644 --- a/servers/slapd/filterentry.c +++ b/servers/slapd/filterentry.c @@ -288,7 +288,6 @@ strcpy_special( char *d, char *s ) case '[': case ']': case '*': - case '+': case '^': case '$': *d++ = '\\'; @@ -386,7 +385,7 @@ test_substring_filter( /* compile the regex */ Debug( LDAP_DEBUG_FILTER, "test_substring_filter: regcomp pat: %s\n", pat, 0, 0 ); - if ((rc = regcomp(&re, pat, 0))) { + if ((rc = regcomp(&re, pat, REG_NOSUB))) { char error[512]; regerror(rc, &re, error, sizeof(error)); diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 4871d23ced..19d162ed53 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -79,6 +79,7 @@ send_ldap_result2( if ( rc == -1 ) { Debug( LDAP_DEBUG_ANY, "ber_printf failed\n", 0, 0, 0 ); + ber_free( ber, 1 ); return; } @@ -89,7 +90,7 @@ send_ldap_result2( bytes = ber->ber_ptr - ber->ber_buf; ldap_pvt_thread_mutex_lock( &new_conn_mutex ); while ( conn->c_connid == op->o_connid && ber_flush( &conn->c_sb, ber, - 1 ) != 0 ) { + 0 ) != 0 ) { ldap_pvt_thread_mutex_unlock( &new_conn_mutex ); /* * we got an error. if it's ewouldblock, we need to @@ -105,6 +106,7 @@ send_ldap_result2( close_connection( conn, op->o_connid, op->o_opid ); ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex ); + ber_free( ber, 1 ); return; } @@ -128,6 +130,8 @@ send_ldap_result2( ldap_pvt_thread_mutex_unlock( &new_conn_mutex ); ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex ); + ber_free( ber, 1 ); + ldap_pvt_thread_mutex_lock( &num_sent_mutex ); num_bytes_sent += bytes; ldap_pvt_thread_mutex_unlock( &num_sent_mutex ); @@ -327,7 +331,7 @@ send_search_entry( bytes = ber->ber_ptr - ber->ber_buf; ldap_pvt_thread_mutex_lock( &new_conn_mutex ); while ( conn->c_connid == op->o_connid && ber_flush( &conn->c_sb, ber, - 1 ) != 0 ) { + 0 ) != 0 ) { ldap_pvt_thread_mutex_unlock( &new_conn_mutex ); /* * we got an error. if it's ewouldblock, we need to @@ -343,6 +347,7 @@ send_search_entry( close_connection( conn, op->o_connid, op->o_opid ); ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex ); + ber_free( ber, 1 ); return( -1 ); } @@ -364,6 +369,8 @@ send_search_entry( ldap_pvt_thread_mutex_unlock( &new_conn_mutex ); ldap_pvt_thread_mutex_unlock( &conn->c_pdumutex ); + ber_free( ber, 1 ); + ldap_pvt_thread_mutex_lock( &num_sent_mutex ); num_bytes_sent += bytes; num_entries_sent++;