aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2020-12-10 17:44:54 -0800
committerAlexander Blair <snipa@jagtech.io>2020-12-10 17:44:54 -0800
commit0f6756927929d44f62fa4301a22c584223552d98 (patch)
tree143b0eb45dc3d8061f8cc584d380111dd2098ec0
parentMerge pull request #7117 (diff)
parentprotocol: one more sanity check on usable data from a peer (diff)
downloadmonero-0f6756927929d44f62fa4301a22c584223552d98.tar.xz
Merge pull request #7121
cd7e9769d protocol: one more sanity check on usable data from a peer (moneromooo-monero)
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index efc239202..27f8888bb 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -2528,7 +2528,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);