diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2017-08-17 21:54:23 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-08-21 09:49:05 +0200 |
commit | 9fe1f6bd898ab1a69fbce2cb9dd93fcbb60b88fd (patch) | |
tree | af96cef135e35ed0adcc9b87d453254976ca1e19 /src | |
parent | 6c2b0085fb4980442a732cb879902d8215ca49d5 (diff) | |
download | bitcoin-9fe1f6bd898ab1a69fbce2cb9dd93fcbb60b88fd.tar.xz |
Add length check for CExtKey deserialization
Github-Pull: #11081
Rebased-From: 07685d1bc1b0b815c00a68a5b7b335ffa0d4d90d
Tree-SHA512: 7f6b9ca6714d059d500531eb842c1c25edfa04ecba0ea1d9a28010fced657c066cea67d2016bbaa9b96c431a05ca9c0dcf2ba301898ecf96a65a4e01aac7fae9
Diffstat (limited to 'src')
-rw-r--r-- | src/key.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -172,6 +172,8 @@ struct CExtKey { { unsigned int len = ::ReadCompactSize(s); unsigned char code[BIP32_EXTKEY_SIZE]; + if (len != BIP32_EXTKEY_SIZE) + throw std::runtime_error("Invalid extended key size\n"); s.read((char *)&code[0], len); Decode(code); } |