CDRIVER-695 crash destroying node after auth err
Avoid scenarios like: 1. Connect to 2-node replica set. 2. _cluster_reconnect_replica_set enters first loop, calls ismaster on primary and finds two peers. 3. nodes_len is set to 2 and the nodes list is realloc'ed, but the second node is uninitialized. 4. _mongoc_cluster_reconnect_replica_set enters second loop. 5. Auth fails, "goto CLEANUP". 6. Now nodes_len is 2 but the second node is still uninitialized. 7. Later, _mongoc_cluster_node_destroy iterates over both nodes. 8. Destroying second, uninitialized node calls stream->close, which is a random location, segfaults.
parent
3f43d637
Please register or sign in to comment