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

Some URI parsing errors do not set the bson_error_t.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.14.0
    • Affects Version/s: None
    • Component/s: libmongoc, uri
    • Labels:

      mongoc_uri_new_with_error should set the passed bson_error_t on parsing error.

      The following two cases do not set the error (and only log a warning).

      mongodb://localhost/db?heartbeatfrequencyms=10 logs:

      Invalid "heartbeatfrequencyms" of 10: must be at least 500
      

      but does not set the error.

      mongodb://localhost/db?zlibcompressionlevel=10 logs:

      Invalid "zlibcompressionlevel" of 10: must be between -1 and 9
      

      but does not set the error.

      These are both validated internally with mongoc_uri_set_option_as_int32, which does not take a bson_error_t.

      Let's make an internal _mongoc_uri_set_option_as_int32_with_error to pull the error out.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: