diff --git a/native/cpp/CommonCpp/CryptoTools/Session.cpp b/native/cpp/CommonCpp/CryptoTools/Session.cpp --- a/native/cpp/CommonCpp/CryptoTools/Session.cpp +++ b/native/cpp/CommonCpp/CryptoTools/Session.cpp @@ -154,7 +154,7 @@ ". Hash: " + std::string{messageHashBuffer.begin(), messageHashBuffer.end()}}; } - return std::string{(char *)decryptedMessage.data(), decryptedSize}; + return std::string{decryptedMessage.begin(), decryptedMessage.end()}; } std::string Session::decryptSequential(EncryptedData &encryptedData) { @@ -199,7 +199,7 @@ std::string{::olm_session_last_error(session)} + ". Hash: " + std::string{messageHashBuffer.begin(), messageHashBuffer.end()}}; } - return std::string{(char *)decryptedMessage.data(), decryptedSize}; + return std::string{decryptedMessage.begin(), decryptedMessage.end()}; } int Session::getVersion() {