Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
None
-
None
-
ALL
Description
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 );
|
}
|
};
|
Attachments
Issue Links
- duplicates
-
SERVER-6646 Strings with NUL bytes don't round-trip correctly from BSON <-> JavaScript
-
- Closed
-