[SERVER-33083] establishCursors should check if host is valid Created: 02/Feb/18  Updated: 29/Oct/23  Resolved: 05/Feb/18

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.7.1
Fix Version/s: 3.7.2

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Mathias Stearn
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2018-02-12
Participants:
Linked BF Score: 0

 Description   

ARS can return an uninitialized boost::option for shardHostAndPort if fails to contact the server. However, we do not perform any checks here:

https://github.com/mongodb/mongo/blob/84c3f83421b262028081296e4c387d29691ea376/src/mongo/s/query/establish_cursors.cpp#L79

Note: this bug is recently introduced and not an issue in v3.6.



 Comments   
Comment by Githook User [ 05/Feb/18 ]

Author:

{'email': 'mathias@10gen.com', 'name': 'Mathias Stearn', 'username': 'RedBeard0531'}

Message: SERVER-33083 Check that Response is valid before accessing optional field
Branch: master
https://github.com/mongodb/mongo/commit/b7a8411eed8fece571b48406b0be02ed1bc9eacf

Comment by Andy Schwerin [ 03/Feb/18 ]

Can you link the patch that introduced this behavior?

Generated at Thu Feb 08 04:32:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.