-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
Pointer is checked against null but then dereferenced anyway
Defect 67269 (STATIC_C)
Checker FORWARD_NULL (subcategory none)
File: /src/mongoc/mongoc-topology-description.c
Function _mongoc_topology_description_update_rs_from_primary
/src/mongoc/mongoc-topology-description.c, line: 892
Comparing "server->set_name" to null implies that "server->set_name" might be null.
if (!topology->set_name && server->set_name) {
/src/mongoc/mongoc-topology-description.c, line: 895
Passing null pointer "server->set_name" to "strcmp", which dereferences it.
else if (strcmp(topology->set_name, server->set_name) != 0) {