[CDRIVER-3367] mongoc_cluster_fetch_stream_single should fail gracefully when passed invalid server_id Created: 16/Sep/19  Updated: 28/Oct/23  Resolved: 10/Jan/20

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.16.0

Type: Bug Priority: Minor - P4
Reporter: Samantha Ritter (Inactive) Assignee: Kevin Albertson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

mongoc_cluster_fetch_stream_single calls BSON_ASSERT if it is passed a server_id that is either not present or is marked "retired" in the topology scanner. However, it is possible for a user to call this method with an arbitrary server_id via mongoc_cluster_stream_for_server. Calling BSON_ASSERT should be reserved for logical invariants in the code; since this condition can be triggered by user input, we should fail gracefully rather than crash.



 Comments   
Comment by Githook User [ 10/Jan/20 ]

Author:

{'name': 'Kevin Albertson', 'email': 'kevin.albertson@mongodb.com', 'username': 'kevinAlbs'}

Message: CDRIVER-3367 fail gracefully for invalid server id
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/c2ce6c6df577ab0729424a12b213343f1938695a

Comment by Kevin Albertson [ 16/Sep/19 ]

Note, I'm assuming this is called through the public facing function mongoc_client_command_simple_with_server_id.

Generated at Wed Feb 07 21:17:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.