Browse Source

Merge #10226: wallet: Use boost to more portably ensure -wallet specifies only a filename

a4186dd wallet: Use boost to more portably ensure -wallet specifies only a filename (Luke Dashjr)

Tree-SHA512: 6dfde31fa599638e5ec76489363e2fed97403be3e5762e4560dfc6ac261ce169a92b5a1b92bb34a893cc898e6073c81f74f49528e8df07e86273ddb37dd1ce80
0.15
Wladimir J. van der Laan 8 years ago
parent
commit
64c45aada7
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 2
      src/wallet/wallet.cpp

2
src/wallet/wallet.cpp

@ -3887,7 +3887,7 @@ bool CWallet::InitLoadWallet()
std::string walletFile = GetArg("-wallet", DEFAULT_WALLET_DAT); std::string walletFile = GetArg("-wallet", DEFAULT_WALLET_DAT);
if (walletFile.find_first_of("/\\") != std::string::npos) { if (boost::filesystem::path(walletFile).filename() != walletFile) {
return InitError(_("-wallet parameter must only specify a filename (not a path)")); return InitError(_("-wallet parameter must only specify a filename (not a path)"));
} else if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) { } else if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) {
return InitError(_("Invalid characters in -wallet filename")); return InitError(_("Invalid characters in -wallet filename"));

Loading…
Cancel
Save