Skip to content

Commit b08af10

Browse files
committed
disallow oversized CBlockHeaderAndShortTxIDs
Otherwise we'd reply with a bogus BlockTransactionsRequest trying to request indexes with overflowed deltas.
1 parent 6bed4b3 commit b08af10

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/blockencodings.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ class CBlockHeaderAndShortTxIDs {
186186

187187
READWRITE(prefilledtxn);
188188

189+
if (BlockTxCount() > std::numeric_limits<uint16_t>::max())
190+
throw std::ios_base::failure("indexes overflowed 16 bits");
191+
189192
if (ser_action.ForRead())
190193
FillShortTxIDSelector();
191194
}

0 commit comments

Comments
 (0)