diff options
| author | João Barbosa <[email protected]> | 2017-07-27 00:57:02 +0100 |
|---|---|---|
| committer | João Barbosa <[email protected]> | 2017-07-28 11:23:43 +0100 |
| commit | a6da027d83e48f05c933149ff89c9b9ad5ced915 (patch) | |
| tree | 4a1b394b8304dc6f1163e8e6ed96e4a19bf08fe6 /src | |
| parent | Reject duplicate wallet filenames (diff) | |
| download | discoin-a6da027d83e48f05c933149ff89c9b9ad5ced915.tar.xz discoin-a6da027d83e48f05c933149ff89c9b9ad5ced915.zip | |
Reject invalid wallet files
Diffstat (limited to 'src')
| -rw-r--r-- | src/wallet/wallet.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index ccf5353eb..ef1d76414 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -482,6 +482,10 @@ bool CWallet::Verify() fs::path wallet_path = fs::absolute(walletFile, GetDataDir()); + if (fs::exists(wallet_path) && (!fs::is_regular_file(wallet_path) || fs::is_symlink(wallet_path))) { + return InitError(_("Invalid -wallet file")); + } + if (!wallet_paths.insert(wallet_path).second) { return InitError(_("Duplicate -wallet filename")); } |