[CDRIVER-3311] Possible crash if server reports maxBsonObjectSize of 0 Created: 12/Aug/19  Updated: 27/Oct/23  Resolved: 20/Jul/23

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

Type: Bug Priority: Trivial - P5
Reporter: Kevin Albertson Assignee: Unassigned
Resolution: Gone away Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: CDRIVER-4575

 Description   

Per this assert we might crash if the server were to report maxBsonObjectSize 0.

This would not happen in practice, since to-date the server only ever reports maxBsonObjectSize of 16MB. But if for some reason it ever did (perhaps a non-data bearing node), and validate with a mock server test that we handle this correctly.



 Comments   
Comment by Kevin Albertson [ 20/Jul/23 ]

_mongoc_write_command_will_overflow was removed in https://github.com/mongodb/mongo-c-driver/commit/46e65b58fc2eaee6ca91437856092024cfbcbbe9

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