[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: |
|
||||
| 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: |
| 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. |