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.
- causes
-
PHPC-2592 Investigate changes in CDRIVER-6017: bson_validate functions are broken by strings/keys that are not valid UTF-8
-
- Closed
-
-
CXX-3302 Bump minimum C Driver version to 2.0.2
-
- Closed
-
- fixes
-
CDRIVER-5710 bson_validate returns byte offset relative to innermost document
-
- Closed
-
- is depended on by
-
PHPC-2592 Investigate changes in CDRIVER-6017: bson_validate functions are broken by strings/keys that are not valid UTF-8
-
- Closed
-