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
This commit is contained in:
Wladimir J. van der Laan 2017-04-19 10:50:59 +02:00
commit 64c45aada7
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
1 changed files with 1 additions and 1 deletions

View File

@ -3887,7 +3887,7 @@ bool CWallet::InitLoadWallet()
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)"));
} else if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) {
return InitError(_("Invalid characters in -wallet filename"));