-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
bson_iter_value returns a bson_value_t to the caller, but the returned value is a reference to an internal member of the iterator. This means that if the iterator gets destroyed, the caller's reference is invalidated. This also means that if the internal state of the iterator changes (for example, from a second call to bson_iter_value) the first value returned to the caller can be altered underneath them.
Let's design a friendlier API that allows the caller to pass in a bson_value_t* that they control, which can be populated with pointers directly into the underlying bson buffer instead of relying on the bson_iter_t as an intermediary.
- related to
-
CDRIVER-3158 Update documentation for bson_iter_value
- Closed