diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-03-29 10:40:32 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-03-29 10:41:04 -0400 |
commit | d979fd7da676eb255294bccaf9e18b7599ba169c (patch) | |
tree | 8b3971454428d332a9cfe904efe1111dfe3c147c | |
parent | 6de759673dba3e69c1b9148403c54a30107cedef (diff) | |
download | mongo-d979fd7da676eb255294bccaf9e18b7599ba169c.tar.gz |
catch empty db names early SERVER-821
-rw-r--r-- | db/db.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -141,8 +141,11 @@ namespace mongo { string _todb( const string& ns ) const { size_t i = ns.find( '.' ); - if ( i == string::npos ) + if ( i == string::npos ){ + uassert( 13074 , "db name can't be empty" , ns.size() ); return ns; + } + uassert( 13075 , "db name can't be empty" , i > 0 ); return ns.substr( 0 , i ); } |