diff options
author | Dwight <dmerriman@gmail.com> | 2009-09-09 16:28:59 -0400 |
---|---|---|
committer | Dwight <dmerriman@gmail.com> | 2009-09-09 16:28:59 -0400 |
commit | fcf361cb2ca13a55b68b99e9a7af9dea48e18a30 (patch) | |
tree | 9279f4acf871c9251813a7dd1531d90ea307e558 | |
parent | b860415ae2a09bb3f81c7c37478017f47b11fe0d (diff) | |
download | mongo-fcf361cb2ca13a55b68b99e9a7af9dea48e18a30.tar.gz |
don't crash if ns len too long
-rw-r--r-- | db/cursor.cpp | 2 | ||||
-rw-r--r-- | db/namespace.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/db/cursor.cpp b/db/cursor.cpp index f61fc6f5b42..fe8673ce70c 100644 --- a/db/cursor.cpp +++ b/db/cursor.cpp @@ -14,7 +14,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "../stdafx.h" +#include "stdafx.h" #include "pdfile.h" namespace mongo { diff --git a/db/namespace.h b/db/namespace.h index 47a404af3e1..dd04d8526f1 100644 --- a/db/namespace.h +++ b/db/namespace.h @@ -84,6 +84,7 @@ namespace mongo { *this = ns; } Namespace& operator=(const char *ns) { + uassert("ns name too long, max size is 128", strlen(ns) < MaxNsLen); memset(buf, 0, MaxNsLen); /* this is just to keep stuff clean in the files for easy dumping and reading */ strcpy_s(buf, MaxNsLen, ns); return *this; |