Skip to content

Commit a4186dd

Browse files
committed
wallet: Use boost to more portably ensure -wallet specifies only a filename
1 parent d678771 commit a4186dd

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
@@ -3765,7 +3765,7 @@ bool CWallet::InitLoadWallet()
37653765

37663766
std::string walletFile = GetArg("-wallet", DEFAULT_WALLET_DAT);
37673767

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

0 commit comments

Comments
 (0)