-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.1.0
-
Component/s: None
-
None
In our test suite, the base URI in standalone server tests is "mongodb://192.168.112.10:2000". If we improperly concatenate this string and create an invalid port (e.g. 2000999), mongoc_uri_parse_host() still attempts to parse it as an unsigned 16-bit integer:
sscanf (end_host, "%hu", &port);
The end result is an exception when the driver cannot connect to a server on port 34919. Would it make more sense to attempt to validate the port and return an error during parsing?