diff options
| author | Luke Dashjr <[email protected]> | 2017-04-18 15:38:02 +0000 |
|---|---|---|
| committer | Luke Dashjr <[email protected]> | 2017-04-18 15:39:16 +0000 |
| commit | a4186dd23944b0b803523632e1578d5c4ebb9e57 (patch) | |
| tree | ddd1e8c219906d42014708f1326a3092234bfc74 /src | |
| parent | Wallet: Sanitise -wallet parameter (diff) | |
| download | discoin-a4186dd23944b0b803523632e1578d5c4ebb9e57.tar.xz discoin-a4186dd23944b0b803523632e1578d5c4ebb9e57.zip | |
wallet: Use boost to more portably ensure -wallet specifies only a filename
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet/wallet.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 446454e9e..64856c1ca 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -3765,7 +3765,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")); |