diff options
| author | Jonas Schnelli <[email protected]> | 2015-07-23 21:05:00 +0200 |
|---|---|---|
| committer | Jonas Schnelli <[email protected]> | 2015-07-25 09:51:52 +0200 |
| commit | 6f8b6d339bf6d6f7fe5a23180e668f7734755d91 (patch) | |
| tree | 68fcf51545f5aa423d0a3e35ed451438d2545833 /src | |
| parent | extend bip32 tests to cover Base58c/CExtKey decode (diff) | |
| download | discoin-6f8b6d339bf6d6f7fe5a23180e668f7734755d91.tar.xz discoin-6f8b6d339bf6d6f7fe5a23180e668f7734755d91.zip | |
don't try to decode invalid encoded ext keys
Diffstat (limited to 'src')
| -rw-r--r-- | src/base58.h | 5 |
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; } |