Skip to content

Commit

Permalink
[BUG] Sanitize wallet name in GetUniqueWalletBackupName
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra authored and furszy committed Jul 21, 2021
1 parent 7aa251d commit 12a1e39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4367,7 +4367,7 @@ bool CWalletTx::AcceptToMemoryPool(CValidationState& state)

std::string CWallet::GetUniqueWalletBackupName() const
{
return strprintf("%s%s", (!m_name.empty() ? m_name : "null"), FormatISO8601DateTimeForBackup(GetTime()));
return strprintf("%s%s", (!m_name.empty() ? SanitizeString(m_name, SAFE_CHARS_FILENAME) : "null"), FormatISO8601DateTimeForBackup(GetTime()));
}

CWallet::CWallet(std::string name, std::unique_ptr<CWalletDBWrapper> dbw) : m_name(std::move(name)), dbw(std::move(dbw))
Expand Down

0 comments on commit 12a1e39

Please sign in to comment.