-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: 1.9.0
-
Component/s: None
phongo_manager_init currently has:
manager->client = php_phongo_make_mongo_client(uri, driverOptions); mongoc_client_set_error_api(manager->client, MONGOC_ERROR_API_VERSION_2); if (!manager->client) { phongo_throw_exception(PHONGO_ERROR_RUNTIME, "Failed to create Manager from URI: '%s'", uri_string); goto cleanup; }
In the unlikely event that php_phongo_make_mongo_client returns NULL, mongoc_client_set_error_api could segfault before we throw an exception. In practice, this does not happen because mongoc_client_new_from_uri only returns NULL if SSL is requested but not enabled in libmongoc and we throw for that case earlier; however, this could change if a new error condition is introduced into libmongoc.