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

Permit NULL as valid platform for mongoc_handshake_data_append

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 1.19.1
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Background & Motivation

      The C++ driver assumes it is OK to pass NULL as the platform string in mongoc_handshake_append_data: https://github.com/mongodb/mongo-cxx-driver/blob/fd84da871c35cbc4beee0b39afa188b84c698fc1/src/mongocxx/instance.cpp#L93. That agrees with the documentation of mongoc_handshake_data_append. It notes all three arguments are optional.

      However, libmongoc currently does not check for NULL in this case: https://github.com/mongodb/mongo-c-driver/blob/25496ec9c57fcd538103bb13ae7b98ec464cfb53/src/libmongoc/src/mongoc/mongoc-handshake.c#L636-L641

      Scope

      • Accept a NULL platform argument in mongoc_handshake_data_append. Handle it equivalently to an empty string.

            Assignee:
            ezra.chung@mongodb.com Ezra Chung
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: