[CDRIVER-576] URI parsing does not validate out-of-range port numbers Created: 12/Mar/15 Updated: 03/May/17 Resolved: 16/Mar/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 1.1.0 |
| Fix Version/s: | TBD |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeremy Mikola | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
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:
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? |
| Comments |
| Comment by Githook User [ 24/Mar/15 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Closes #202 |
| Comment by Githook User [ 16/Mar/15 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: Closes #202 |
| Comment by A. Jesse Jiryu Davis [ 15/Mar/15 ] |