0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

Check that initial int representing size is in valid memory

This commit is contained in:
Aaron 2009-01-16 15:52:17 -05:00
parent 1c2b23bb0f
commit 2a368b1ef4

View File

@ -75,6 +75,7 @@ namespace mongo {
BSONObj nextJsObj() {
if ( nextjsobj == data )
nextjsobj += strlen(data) + 1; // skip namespace
massert( "Remaining data too small for BSON object", theEnd - nextjsobj > 3 );
BSONObj js(nextjsobj);
assert( js.objsize() < ( theEnd - data ) );
if ( js.objsize() <= 0 )