Some URI parsing errors do not set the bson_error_t.

XMLWordPrintableJSON

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

      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:
              A. Jesse Jiryu Davis
              Reporter:
              Kevin Albertson
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: