From 4ba4eec659a0a9c6c2a6e638e35af561b511222e Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Wed, 25 Sep 2024 15:59:52 +0000 Subject: [PATCH] work around defect with stringstream inplace --- src/dpp/dave/persisted_key_pair_generic.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dpp/dave/persisted_key_pair_generic.cpp b/src/dpp/dave/persisted_key_pair_generic.cpp index e648a5a427..fd32af4b79 100755 --- a/src/dpp/dave/persisted_key_pair_generic.cpp +++ b/src/dpp/dave/persisted_key_pair_generic.cpp @@ -92,7 +92,8 @@ std::shared_ptr<::mlspp::SignaturePrivateKey> GetGenericPersistedKeyPair(KeyPair return nullptr; } - curstr = (std::stringstream() << ifs.rdbuf()).str(); + std::stringstream s = (std::stringstream() << ifs.rdbuf()); + curstr = s.str(); if (!ifs) { DISCORD_LOG(LS_ERROR) << "Failed to read key in GetPersistedKeyPair"; return nullptr;