diff options
author | Andrew Morrow <acm@mongodb.com> | 2014-09-23 15:21:55 -0400 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2014-09-24 14:22:48 -0400 |
commit | f1418a12b5edaa3f056a92c0d4e0a38ea5dde171 (patch) | |
tree | 4968e9cda21c33b36b110c8fc4eb76eafa30dbdf /src/mongo/bson/bson_validate.cpp | |
parent | 03d22b14a74564e686fad7b75c093eaf8371321b (diff) | |
download | mongo-f1418a12b5edaa3f056a92c0d4e0a38ea5dde171.tar.gz |
SERVER-15174 Fixup a few overlooked alignment/endian issues in BSON
Diffstat (limited to 'src/mongo/bson/bson_validate.cpp')
-rw-r--r-- | src/mongo/bson/bson_validate.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/bson/bson_validate.cpp b/src/mongo/bson/bson_validate.cpp index 968cac7cbc6..cd11f4bb77a 100644 --- a/src/mongo/bson/bson_validate.cpp +++ b/src/mongo/bson/bson_validate.cpp @@ -30,6 +30,7 @@ #include <cstring> #include <deque> +#include "mongo/base/data_view.h" #include "mongo/bson/bson_validate.h" #include "mongo/bson/oid.h" #include "mongo/db/jsobj.h" @@ -63,8 +64,7 @@ namespace mongo { if ( ( _position + sizeof(N) ) > _maxLength ) return false; if ( out ) { - const N* temp = reinterpret_cast<const N*>(_buffer + _position); - *out = *temp; + *out = ConstDataView(_buffer).readLE<N>(_position); } _position += sizeof(N); return true; |