-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
Scope
Deprecate the bson_string_t type.
Do not deprecate other functions in bson-string.h.
Background & Motivation
bson_string_t has been the source of bug reports: CDRIVER-5628 and CDRIVER-5669. The struct definition is public and is limited to a uint32_t length. Functions that grow the string do not have a way to return error, and instead abort if the resulting length would exceed UINT32_MAX.
bson_string_t is not used in any of the other public API functions (i.e. it is not a return type, or a parameter type). libmongocrypt only uses bson_string_t in test code. The only non-internal use of bson_string_new I found with GitHub code search was in postgresbson using the private function _bson_iso8601_date_format. I expect this can be updated without significant effort.
Other functions declared in bson-string.h may have more expected use. bson_strfreev is expected to be used for return of mongoc_client_get_database_names. libmongocrypt uses bson_strdup, bson_strdup_printf, bson_strdupv_printf, bson_strndup, bson_strncpy, bson_snprintf, bson_strcasecmp.
- has to be done before
-
CDRIVER-5698 Remove bson_string_t
- Backlog