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

Test that mongoc_topology_compatible accepts null bson_error_t pointer

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.1, 1.9.0
    • Affects Version/s: 1.9.0
    • Component/s: libmongoc
    • None

      An incompatible topology is possible beginning in 1.9.0 when we bump our min wire version to 2 (dropping support for MongoDB 2.4 and older).

      We have a risky convention throughout our code that bson_error_t pointers can be NULL, which sometimes bites us. There was a latent bug in mongoc_topology_compatible that tried to memcpy topology->compatibility_error to the bson_error_t out-pointer even if the latter was NULL, fixed as part of CDRIVER-2270. Write a test to prevent regression.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: