Permalink
Browse files

Merge #7932: CAddrMan::Deserialize handle corrupt serializations better.

fb26bf0 CAddrMan::Deserialize handle corrupt serializations better. (Patrick Strateman)
  • Loading branch information...
laanwj committed May 18, 2016
2 parents 457b9df + fb26bf0 commit ed749bdb648046fdaff232cc1870c6163e57c23f
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/addrman.h
View
@@ -350,6 +350,14 @@ class CAddrMan
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];

0 comments on commit ed749bd

Please sign in to comment.