diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2017-07-27 00:57:02 +0100 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2017-07-28 11:23:43 +0100 |
commit | a6da027d83e48f05c933149ff89c9b9ad5ced915 (patch) | |
tree | 4a1b394b8304dc6f1163e8e6ed96e4a19bf08fe6 /src | |
parent | 3ef77a0c1288df524fdf0c90ca70c986f473b787 (diff) |
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 ccf5353eb7..ef1d764146 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")); } |