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

Documentation for several mongoc_uri_*() methods which return pointer types fail to state that NULL can be returned

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.15.0
    • Affects Version/s: None
    • Component/s: Docs, libmongoc

      From empirical testing and code inspection, it appears that a number of mongoc_uri_*() methods with pointer return types which are not documented to return NULL can indeed return NULL.

      The following is a list of all mongoc_uri_*() API functions from the 1.6.0 documentation, filtered down to exclude any function which either 1) doesn't return a pointer, or 2) is already documented to possibly return NULL. Please determine the subset of API functions for which callers must check for NULL before assuming the returned pointer is valid, and update the documentation accordingly for the functions in that subset.

      • mongoc_uri_copy()
      • mongoc_uri_get_auth_mechanism()
      • mongoc_uri_get_auth_source()
      • mongoc_uri_get_database()
      • mongoc_uri_get_hosts()
      • mongoc_uri_get_mechanism_properties()
      • mongoc_uri_get_option_as_utf8()
      • mongoc_uri_get_options()
      • mongoc_uri_get_password()
      • mongoc_uri_get_read_concern()
      • mongoc_uri_get_read_prefs()
      • mongoc_uri_get_read_prefs_t()
      • mongoc_uri_get_replica_set()
      • mongoc_uri_get_string()
      • mongoc_uri_get_username()
      • mongoc_uri_get_write_concern()
      • mongoc_uri_new_for_host_port()
      • mongoc_uri_unescape()

            Assignee:
            isabel.atkinson@mongodb.com Isabel Atkinson
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: