aboutsummaryrefslogtreecommitdiff
path: root/src/pubkey.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-11-06 19:08:29 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-11-09 17:41:35 +0100
commitfa18038f519db76befb9a7bd0b1540143bfeb12b (patch)
tree7e8fe834727923443b53e92525b3ca3610b636ad /src/pubkey.h
parentfabe18d0b39b4b918bf60e3a313eaa36fb4067f2 (diff)
refactor: Use ignore helper when unserializing an invalid pubkey
Diffstat (limited to 'src/pubkey.h')
-rw-r--r--src/pubkey.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pubkey.h b/src/pubkey.h
index 861a2cf500..ab0f429ca9 100644
--- a/src/pubkey.h
+++ b/src/pubkey.h
@@ -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();
}
}