diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2017-08-17 21:54:23 +0200 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2017-08-17 21:54:23 +0200 |
commit | 07685d1bc1b0b815c00a68a5b7b335ffa0d4d90d (patch) | |
tree | 6a4ba8d61c0f0b8a95df156c0878996d01991837 | |
parent | 22e301a3d56dc9e6878380ee92c7d19ca43119d2 (diff) |
Add length check for CExtKey deserialization
-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); } |