aboutsummaryrefslogtreecommitdiff
path: root/src/pubkey.h
diff options
context:
space:
mode:
authorElichai Turkel <elichai.turkel@gmail.com>2020-06-10 17:34:28 +0300
committerElichai Turkel <elichai.turkel@gmail.com>2020-06-10 17:35:43 +0300
commit9b8907faded8e4ec312c0dd4b4b15e1793876acd (patch)
tree5ceaef9f84225fa096caa708ec6674964d185a6c /src/pubkey.h
parent6762a627ecb89ba8d4ed81a049a5d802e6dd75c2 (diff)
Check size after Unserializing CPubKey
Diffstat (limited to 'src/pubkey.h')
-rw-r--r--src/pubkey.h3
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;