From 3a3370096e7564063d9d4f2c645090077f0f86f9 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 10 Dec 2020 22:59:15 +0000 Subject: [PATCH] protocol: one more sanity check on usable data from a peer --- src/cryptonote_protocol/cryptonote_protocol_handler.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index c62a0cd31..31fb2b1b8 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -2522,7 +2522,7 @@ skip: } uint64_t n_use_blocks = m_core.prevalidate_block_hashes(arg.start_height, arg.m_block_ids, arg.m_block_weights); - if (n_use_blocks + HASH_OF_HASHES_STEP <= arg.m_block_ids.size()) + if (n_use_blocks == 0 || n_use_blocks + HASH_OF_HASHES_STEP <= arg.m_block_ids.size()) { LOG_ERROR_CCONTEXT("Most blocks are invalid, dropping connection"); drop_connection(context, true, false);