diff options
author | Elichai Turkel <elichai.turkel@gmail.com> | 2020-06-10 17:34:28 +0300 |
---|---|---|
committer | Elichai Turkel <elichai.turkel@gmail.com> | 2020-06-10 17:35:43 +0300 |
commit | 9b8907faded8e4ec312c0dd4b4b15e1793876acd (patch) | |
tree | 5ceaef9f84225fa096caa708ec6674964d185a6c | |
parent | 6762a627ecb89ba8d4ed81a049a5d802e6dd75c2 (diff) | |
download | bitcoin-9b8907faded8e4ec312c0dd4b4b15e1793876acd.tar.xz |
Check size after Unserializing CPubKey
-rw-r--r-- | src/pubkey.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pubkey.h b/src/pubkey.h index 261842b7f7..4c28af4a4d 100644 --- a/src/pubkey.h +++ b/src/pubkey.h @@ -142,6 +142,9 @@ public: unsigned int len = ::ReadCompactSize(s); if (len <= SIZE) { s.read((char*)vch, len); + if (len != size()) { + Invalidate(); + } } else { // invalid pubkey, skip available data char dummy; |