-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
-
ALL
Observed behavior: A null character in a bson string is treated as an end of string character on conversion to Value, causing early string termination.
Expected behavior: String values containing null characters are round trippable between bson and Value.
class StringWithNull { public: void run() { string withNull( "a\0b", 3 ); BSONObj objWithNull = BSON( "" << withNull ); ASSERT_EQUALS( withNull, objWithNull[ "" ].str() ); intrusive_ptr<const Value> value = fromBson( objWithNull ); ASSERT_EQUALS( withNull, value->getString() ); assertRoundTrips( value ); } };
- duplicates
-
SERVER-6646 Strings with NUL bytes don't round-trip correctly from BSON <-> JavaScript
- Closed