summaryrefslogtreecommitdiff
path: root/src/mongo/bson/bsonelement.h
diff options
context:
space:
mode:
authorAndreas Nilsson <andreas.nilsson@10gen.com>2013-05-30 19:39:57 +0100
committerAndreas Nilsson <andreas.nilsson@10gen.com>2013-05-30 21:35:24 +0100
commitd321ec5375acd7aa0b7abc1c375200c8d955ffb4 (patch)
tree6226b2fd860fe0d4d4a49614ea33318a1a3b6ef4 /src/mongo/bson/bsonelement.h
parent29112149f51cd3eaa0149ba9d4e16cc935d03b40 (diff)
downloadmongo-d321ec5375acd7aa0b7abc1c375200c8d955ffb4.tar.gz
SERVER-9808 Fix issues found in CoN static analysis
Diffstat (limited to 'src/mongo/bson/bsonelement.h')
-rw-r--r--src/mongo/bson/bsonelement.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mongo/bson/bsonelement.h b/src/mongo/bson/bsonelement.h
index a4e51b75b61..f094ab91994 100644
--- a/src/mongo/bson/bsonelement.h
+++ b/src/mongo/bson/bsonelement.h
@@ -23,6 +23,7 @@
#include "mongo/bson/bsontypes.h"
#include "mongo/bson/oid.h"
+#include "mongo/platform/cstdint.h"
#include "mongo/platform/float_utils.h"
namespace mongo {
@@ -237,8 +238,8 @@ namespace mongo {
}
// for objects the size *includes* the size of the size field
- int objsize() const {
- return *reinterpret_cast< const int* >( value() );
+ size_t objsize() const {
+ return static_cast< const size_t >( *reinterpret_cast< const uint32_t* >( value() ) );
}
/** Get a string's value. Also gives you start of the real data for an embedded object.