diff options
author | Mathias Stearn <redbeard0531@gmail.com> | 2010-07-13 23:16:48 -0400 |
---|---|---|
committer | Mathias Stearn <redbeard0531@gmail.com> | 2010-07-13 23:21:20 -0400 |
commit | f4266aedd22c75d64c0250ecf62d21bcdfd31766 (patch) | |
tree | 472fba930ed39befb8d208d7589c0bceb6e870ec /db/json.cpp | |
parent | c8992ae056a0cb8804a2443c974aabd90b5e8e02 (diff) | |
download | mongo-f4266aedd22c75d64c0250ecf62d21bcdfd31766.tar.gz |
I didn't understand strnlen's return value SERVER-1416
Diffstat (limited to 'db/json.cpp')
-rw-r--r-- | db/json.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/db/json.cpp b/db/json.cpp index 208d78f5c0f..185a8ca0290 100644 --- a/db/json.cpp +++ b/db/json.cpp @@ -570,6 +570,7 @@ public: *len = result.stop - str; } else if ( !result.full ) { int limit = strnlen(result.stop , 10); + if (limit == -1) limit = 10; msgasserted(10340, "Failure parsing JSON string near: " + string( result.stop, limit )); } BSONObj ret = b.pop(); |