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

Error condition is not handled correctly for NULL value

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.0
    • Affects Version/s: None
    • Component/s: None
    • None

      if (!node.replSet || !!strcmp (node.replSet, replSet)) {
         MONGOC_INFO("%s: Got replicaSet \"%s\" expected \"%s\".",
                     iter->host_and_port, node.replSet, replSet);
      }
      

      Error condition in the above listed code will cause a crash for node.replSet == null condition while trying tot print that value.

      This is generally unsafe and should rather be something like {{ (node.replSet ? node.replSet : "<null>") }} in the MONGOC_INFO.

            Assignee:
            Unassigned Unassigned
            Reporter:
            anil.kumar Anil Kumar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: