diff options
author | Matt Kneiser <matt.kneiser@mongodb.com> | 2022-10-14 18:14:57 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-10-14 18:40:46 +0000 |
commit | 6b0da0b92763dfdabe8381922dc16c09a70e47b2 (patch) | |
tree | 7ba3b31a1af417155e99db6656a50ddebe2babfa | |
parent | 05eecacc3c0a95b1b3f8667ead8e1322ffe88363 (diff) | |
download | mongo-6b0da0b92763dfdabe8381922dc16c09a70e47b2.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 |