aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/dump.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2021-12-21 11:02:41 -0500
committerAndrew Chow <achow101-github@achow101.com>2021-12-26 12:33:23 -0500
commitac617cc141fe05bea0dc5e8f9df3da43c0945842 (patch)
tree64e9f09a0ecdcf40cc9caaaa08b76ab2a7285193 /src/wallet/dump.cpp
parent887796a5ffcbafcd281b920f8d55fcb6e8347584 (diff)
downloadbitcoin-ac617cc141fe05bea0dc5e8f9df3da43c0945842.tar.xz
wallettool: Check that the dumpfile checksum is the correct size
After parsing the checksum, make sure that it is the size that we expect it to be.
Diffstat (limited to 'src/wallet/dump.cpp')
-rw-r--r--src/wallet/dump.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/dump.cpp b/src/wallet/dump.cpp
index e50b4ca5f7..8347f50cf7 100644
--- a/src/wallet/dump.cpp
+++ b/src/wallet/dump.cpp
@@ -214,6 +214,11 @@ bool CreateFromDump(const std::string& name, const fs::path& wallet_path, biling
if (key == "checksum") {
std::vector<unsigned char> parsed_checksum = ParseHex(value);
+ if (parsed_checksum.size() != checksum.size()) {
+ error = Untranslated("Error: Checksum is not the correct size");
+ ret = false;
+ break;
+ }
std::copy(parsed_checksum.begin(), parsed_checksum.end(), checksum.begin());
break;
}