Check size after Unserializing CPubKey

pull/764/head
Elichai Turkel 4 years ago
parent 6762a627ec
commit 9b8907fade
No known key found for this signature in database
GPG Key ID: 9383CDE9E8E66A7F

@ -142,6 +142,9 @@ public:
unsigned int len = ::ReadCompactSize(s); unsigned int len = ::ReadCompactSize(s);
if (len <= SIZE) { if (len <= SIZE) {
s.read((char*)vch, len); s.read((char*)vch, len);
if (len != size()) {
Invalidate();
}
} else { } else {
// invalid pubkey, skip available data // invalid pubkey, skip available data
char dummy; char dummy;

Loading…
Cancel
Save