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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 1.17.0-rc0, 1.17.0
    • None
    • libmongoc
    • None

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: