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 committed by Pasta
parent 7fa60a1c73
commit 16053cd528
No known key found for this signature in database
GPG Key ID: 0B8EB7A31A44D9C6

View File

@ -5018,7 +5018,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"));