Skip to content

Commit

Permalink
Add length check for CExtKey deserialization
Browse files Browse the repository at this point in the history
Github-Pull: #11081
Rebased-From: 07685d1
Tree-SHA512: 7f6b9ca6714d059d500531eb842c1c25edfa04ecba0ea1d9a28010fced657c066cea67d2016bbaa9b96c431a05ca9c0dcf2ba301898ecf96a65a4e01aac7fae9
  • Loading branch information
jonasschnelli authored and laanwj committed Aug 21, 2017
1 parent 6c2b008 commit 9fe1f6b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/key.h
Expand Up @@ -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);

This comment has been minimized.

Copy link
@thomm45

thomm45 Mar 12, 2018

mywallet

}
Expand Down

0 comments on commit 9fe1f6b

Please sign in to comment.