[CDRIVER-4290] _mongoc_cursor_fetch_stream may fail to check for non-null server stream Created: 10/Feb/22  Updated: 28/Oct/23  Resolved: 10/Feb/22

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

Type: Bug Priority: Major - P3
Reporter: Jeremy Mikola Assignee: Jeremy Mikola
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related

 Description   

When _mongoc_cursor_fetch_stream was modified in 9eba451 for CDRIVER-3893, a code path was introduced where the return value of mongoc_cluster_stream_for_server was no longer checked for a null value before access.

There are few conditions where mongoc_cluster_stream_for_server might return null, but I observed this through a segfault in PHPC's server-executeQuery-012.phpt test due a mismatched server hint and pinned client session.



 Comments   
Comment by Githook User [ 10/Feb/22 ]

Author:

{'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}

Message: Skip test pending libmongoc segfault fix (CDRIVER-4290)
Branch: master
https://github.com/mongodb/mongo-php-driver/commit/220541ac3c4a549082105f34418a0a5eff5cb762

Comment by Githook User [ 10/Feb/22 ]

Author:

{'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}

Message: CDRIVER-4290 check for null server stream in _mongoc_cursor_fetch_stream (#945)
Branch: r1.21
https://github.com/mongodb/mongo-c-driver/commit/0631e099a5360a699e4c74507aec2be2c133d77c

Comment by Githook User [ 10/Feb/22 ]

Author:

{'name': 'Jeremy Mikola', 'email': 'jmikola@gmail.com', 'username': 'jmikola'}

Message: CDRIVER-4290 check for null server stream in _mongoc_cursor_fetch_stream (#945)
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/7f4f9ffcd2702be5083875755104fa87582e1b64

Comment by Jeremy Mikola [ 10/Feb/22 ]

https://github.com/mongodb/mongo-c-driver/pull/945

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