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:
parent
1c2b23bb0f
commit
2a368b1ef4
@ -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 )
|
||||
|
Loading…
Reference in New Issue
Block a user