Skip to content

Commit

Permalink
disallow oversized CBlockHeaderAndShortTxIDs
Browse files Browse the repository at this point in the history
Otherwise we'd reply with a bogus BlockTransactionsRequest trying to
request indexes with overflowed deltas.
  • Loading branch information
kazcw committed Nov 13, 2018
1 parent 6bed4b3 commit b08af10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/blockencodings.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ class CBlockHeaderAndShortTxIDs {

READWRITE(prefilledtxn);

if (BlockTxCount() > std::numeric_limits<uint16_t>::max())
throw std::ios_base::failure("indexes overflowed 16 bits");

if (ser_action.ForRead())
FillShortTxIDSelector();
}
Expand Down

0 comments on commit b08af10

Please sign in to comment.