diff options
author | Matt Kneiser <matt.kneiser@mongodb.com> | 2022-10-14 18:14:47 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-10-14 18:49:21 +0000 |
commit | cdbfe8cdaecc79d5cf53eeddd7a064edbe3214ee (patch) | |
tree | 1c9ab3aebcd2d2e26f6f413a54d44d78f5763789 | |
parent | a67309066f0b6f67f052e2453fc02bbcceb953df (diff) | |
download | mongo-cdbfe8cdaecc79d5cf53eeddd7a064edbe3214ee.tar.gz |
SERVER-69784 Fix signed char misuses
(cherry picked from commit 1912e879e904b96a331cd2a2d20e7abf23684359)
-rw-r--r-- | src/mongo/shell/linenoise.cpp | 5 | ||||
-rw-r--r-- | src/mongo/util/net/ssl_manager.cpp | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/mongo/shell/linenoise.cpp b/src/mongo/shell/linenoise.cpp index 679578d133b..d62082aa089 100644 --- a/src/mongo/shell/linenoise.cpp +++ b/src/mongo/shell/linenoise.cpp @@ -119,6 +119,7 @@ #include <string> #include <vector> +#include "mongo/base/data_view.h" #include "mongo/util/errno_util.h" using std::string; @@ -352,7 +353,7 @@ public: } Utf32String killedText(text, textLen); if (lastAction == actionKill && size > 0) { - int slot = indexToSlot[0]; + int slot = mongo::ConstDataView(&indexToSlot[0]).read<uint8_t>(); int currentLen = theRing[slot].length(); int resultLen = currentLen + textLen; Utf32String temp(resultLen + 1); @@ -375,7 +376,7 @@ public: size++; theRing.push_back(killedText); } else { - int slot = indexToSlot[capacity - 1]; + int slot = mongo::ConstDataView(&indexToSlot[capacity - 1]).read<uint8_t>(); theRing[slot] = killedText; memmove(&indexToSlot[1], &indexToSlot[0], capacity - 1); indexToSlot[0] = slot; diff --git a/src/mongo/util/net/ssl_manager.cpp b/src/mongo/util/net/ssl_manager.cpp index 2f4a6fb713f..6bb855f8058 100644 --- a/src/mongo/util/net/ssl_manager.cpp +++ b/src/mongo/util/net/ssl_manager.cpp @@ -38,6 +38,7 @@ #include <string> #include <vector> +#include "mongo/base/data_view.h" #include "mongo/base/init.h" #include "mongo/bson/bsonobjbuilder.h" #include "mongo/client/internal_auth.h" @@ -1048,7 +1049,7 @@ StatusWith<DERToken> DERToken::parse(ConstDataRange cdr, size_t* outLength) { derLength = ConstDataView(lengthBuffer.data()).read<BigEndian<uint64_t>>(); } else { // Length is <= 127 bytes, i.e. short form of length - derLength = initialLengthByte; + derLength = ConstDataView(&initialLengthByte).read<uint8_t>(); } // This is the total length of the TLV and all data |