Skip to content

Commit 64c45aa

Browse files
committed
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
2 parents 9111df9 + a4186dd commit 64c45aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3887,7 +3887,7 @@ bool CWallet::InitLoadWallet()
38873887

38883888
std::string walletFile = GetArg("-wallet", DEFAULT_WALLET_DAT);
38893889

3890-
if (walletFile.find_first_of("/\\") != std::string::npos) {
3890+
if (boost::filesystem::path(walletFile).filename() != walletFile) {
38913891
return InitError(_("-wallet parameter must only specify a filename (not a path)"));
38923892
} else if (SanitizeString(walletFile, SAFE_CHARS_FILENAME) != walletFile) {
38933893
return InitError(_("Invalid characters in -wallet filename"));

0 commit comments

Comments
 (0)