Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3539

Callers of _mongoc_cluster_create_server_stream must check if the return is NULL

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.17.0-rc0, 1.17.0
    • Affects Version/s: None
    • Component/s: libmongoc
    • Labels:
      None

      The call to _mongoc_cluster_create_server_stream takes a mongoc_stream_t to a server and an integer ID to the server. On success, it returns a mongoc_server_stream_t which contains the passed mongoc_stream_t and a copy of a mongoc_server_description_t. On failure, it returns NULL. Many callers appear to assume it does not return NULL.

      It may fail if it no server description is found for the server, which may happen during monitoring if the server description is removed by the rules of updating the topology description SDAM. This would likely cause a crash.

            Assignee:
            andrew.witten@mongodb.com Andrew Witten (Inactive)
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: