Investigate changes in CDRIVER-6017: bson_validate functions are broken by strings/keys that are not valid UTF-8

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      The BSON_VALIDATE_UTF8 flag requests that the bson_validate family of functions check the content of UTF-8 text elements for byte sequences that are not valid UTF-8. This flag never has any effect, because the bson_iter_visit_all function checks for invalid UTF-8 before the validating visitor gets a chance to inspect the element content.

      bson_iter_visit_all sets an err_off on the iterator, but the validation functions do not check this value. Instead, they halt early on invalid UTF-8 sequences, and then report success. This is also a problem when keys contain invalid UTF-8, because the visitor still does not see the element and does not inspect iter.err_off.

              Assignee:
              Unassigned
              Reporter:
              Service Account: DBX TPM
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: