mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-22 06:52:36 +01:00
refactor: Use ignore helper when unserializing an invalid pubkey
This commit is contained in:
parent
fabe18d0b3
commit
fa18038f51
1 changed files with 2 additions and 4 deletions
|
@ -141,7 +141,7 @@ public:
|
|||
template <typename Stream>
|
||||
void Unserialize(Stream& s)
|
||||
{
|
||||
unsigned int len = ::ReadCompactSize(s);
|
||||
const unsigned int len(::ReadCompactSize(s));
|
||||
if (len <= SIZE) {
|
||||
s.read((char*)vch, len);
|
||||
if (len != size()) {
|
||||
|
@ -149,9 +149,7 @@ public:
|
|||
}
|
||||
} else {
|
||||
// invalid pubkey, skip available data
|
||||
char dummy;
|
||||
while (len--)
|
||||
s.read(&dummy, 1);
|
||||
s.ignore(len);
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue