Add MakeSecureString helper, eliminate .c_str() in password paths
- Add MakeSecureString(const std::string&) in allocators.h - Replace .c_str() shims in walletpassphrase, walletpassphrasechange, encryptwallet RPCs and askpassphrasedialog - Update TODO_DOCUMENTATION.md to mark issue as resolved Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -254,4 +254,9 @@ struct zero_after_free_allocator : public std::allocator<T>
|
||||
// This is exactly like std::string, but with a custom allocator.
|
||||
typedef std::basic_string<char, std::char_traits<char>, secure_allocator<char> > SecureString;
|
||||
|
||||
static inline SecureString MakeSecureString(const std::string& value)
|
||||
{
|
||||
return SecureString(value.begin(), value.end());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user