From 2f9fd2932164eb86005e91cffcc66d2d79322db0 Mon Sep 17 00:00:00 2001 From: Kaz Wesley Date: Tue, 13 Nov 2018 12:40:22 -0800 Subject: disallow oversized CBlockHeaderAndShortTxIDs Otherwise we'd reply with a bogus BlockTransactionsRequest trying to request indexes with overflowed deltas. Github-Pull: #14685 Rebased-From: b08af10fb299dc3fdcd1f022619fb112c72e5d8e --- src/blockencodings.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/blockencodings.h') diff --git a/src/blockencodings.h b/src/blockencodings.h index 4bfe538250..0c2b83ebcf 100644 --- a/src/blockencodings.h +++ b/src/blockencodings.h @@ -186,6 +186,9 @@ public: READWRITE(prefilledtxn); + if (BlockTxCount() > std::numeric_limits::max()) + throw std::ios_base::failure("indexes overflowed 16 bits"); + if (ser_action.ForRead()) FillShortTxIDSelector(); } -- cgit v1.2.3