-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
In the legacy BSON C-extension, we're attempting to use a byte buffer in an error message to get the buffer's size after we've already deallocated it:
if (length > bson_buffer_get_max_size(buffer)) { bson_buffer_free(buffer); rb_raise(InvalidDocument, "Document too large: This BSON document is limited to %d bytes.", bson_buffer_get_max_size(buffer)); return; }
Link:
https://github.com/mongodb/mongo-ruby-driver/blob/master/ext/cbson/cbson.c#L603-L610