]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9831 Advance connections[index] correctly
authorOndřej Kuzník <ondra@mistotebe.net>
Mon, 25 Apr 2022 15:53:25 +0000 (16:53 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 26 Apr 2022 23:23:09 +0000 (23:23 +0000)
servers/slapd/connection.c

index e2f3a811ed4825394ca88ae300f5596c56b7932e..9b363fe134ddb380d1cea4dc8f7e4fade7f0b309 100644 (file)
@@ -871,13 +871,14 @@ Connection* connection_next( Connection *c, ber_socket_t *index )
 
        for(; *index < dtblsize; (*index)++) {
                if( connections[*index].c_sb ) {
-                       c = &connections[(*index)++];
+                       c = &connections[*index];
                        ldap_pvt_thread_mutex_lock( &c->c_mutex );
                        if ( c->c_conn_state == SLAP_C_INVALID ) {
                                ldap_pvt_thread_mutex_unlock( &c->c_mutex );
                                c = NULL;
                                continue;
                        }
+                       (*index)++;
                        break;
                }
        }