Permit NULL as valid platform for mongoc_handshake_data_append

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Critical - P2
    • 1.19.1
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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
            Reporter:
            Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: