[SERVER-6556] aggregation Value does not handle string values with null characters properly Created: 22/Jul/12  Updated: 11/Jul/16  Resolved: 03/Aug/12

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: None
Fix Version/s: 2.2.0-rc1

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: HTML File testbugs_output.html    
Issue Links:
Duplicate
duplicates SERVER-6646 Strings with NUL bytes don't round-tr... Closed
Related
Operating System: ALL
Participants:

 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 );                
            }
        };



 Comments   
Comment by auto [ 03/Aug/12 ]

Author:

{u'date': u'2012-08-03T09:35:18-07:00', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}

Message: Disable test for SERVER-6556 on V8 due to SERVER-6646
Branch: master
https://github.com/mongodb/mongo/commit/a1382fdb96bd73e525d6f5499efc31456c07827a

Comment by auto [ 01/Aug/12 ]

Author:

{u'date': u'2012-07-27T15:15:56-07:00', u'email': u'aaron@10gen.com', u'name': u'Aaron'}

Message: SERVER-6556 Enable test.
Branch: master
https://github.com/mongodb/mongo/commit/7240761aed3ad4cb25d2dfd2a141a5cd9658c165

Comment by auto [ 27/Jul/12 ]

Author:

{u'date': u'2012-07-25T07:47:24-07:00', u'email': u'dannenberg.matt@gmail.com', u'name': u'Matt Dannenberg'}

Message: SERVER-6556 handle strings containing null in agg
Branch: master
https://github.com/mongodb/mongo/commit/c86c2aee41cf671066eb46933de15c8df49e615b

Comment by Mathias Stearn [ 25/Jul/12 ]

Matt already completed this - pending cr

Comment by Aaron Staple [ 22/Jul/12 ]

Tentatively assigning to 2.3.0.

Generated at Thu Feb 08 03:12:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.