mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
CAddrMan::Deserialize handle corrupt serializations better.
This commit is contained in:
parent
04a2937357
commit
fb26bf0ea3
@ -350,6 +350,14 @@ public:
|
||||
nUBuckets ^= (1 << 30);
|
||||
}
|
||||
|
||||
if (nNew > ADDRMAN_NEW_BUCKET_COUNT * ADDRMAN_BUCKET_SIZE) {
|
||||
throw std::ios_base::failure("Corrupt CAddrMan serialization, nNew exceeds limit.");
|
||||
}
|
||||
|
||||
if (nTried > ADDRMAN_TRIED_BUCKET_COUNT * ADDRMAN_BUCKET_SIZE) {
|
||||
throw std::ios_base::failure("Corrupt CAddrMan serialization, nTried exceeds limit.");
|
||||
}
|
||||
|
||||
// Deserialize entries from the new table.
|
||||
for (int n = 0; n < nNew; n++) {
|
||||
CAddrInfo &info = mapInfo[n];
|
||||
|
Loading…
Reference in New Issue
Block a user