aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonas Schnelli <[email protected]>2015-07-23 21:05:00 +0200
committerJonas Schnelli <[email protected]>2015-07-25 09:51:52 +0200
commit6f8b6d339bf6d6f7fe5a23180e668f7734755d91 (patch)
tree68fcf51545f5aa423d0a3e35ed451438d2545833 /src
parentextend bip32 tests to cover Base58c/CExtKey decode (diff)
downloaddiscoin-6f8b6d339bf6d6f7fe5a23180e668f7734755d91.tar.xz
discoin-6f8b6d339bf6d6f7fe5a23180e668f7734755d91.zip
don't try to decode invalid encoded ext keys
Diffstat (limited to 'src')
-rw-r--r--src/base58.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/base58.h b/src/base58.h
index d535491bb..90014b949 100644
--- a/src/base58.h
+++ b/src/base58.h
@@ -146,7 +146,10 @@ public:
K GetKey() {
K ret;
- ret.Decode(&vchData[0]);
+ if (vchData.size() == Size) {
+ //if base58 encouded data not holds a ext key, return a !IsValid() key
+ ret.Decode(&vchData[0]);
+ }
return ret;
}