aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2020-12-10 17:57:18 -0800
committerAlexander Blair <snipa@jagtech.io>2020-12-10 17:57:18 -0800
commit7a9ba3f15483e01b55d3138c6cb1a53f344116a3 (patch)
treeaa27c9f40ba1699436d668051221ff6d0b1d79f5
parentMerge pull request #7120 (diff)
parentprotocol: one more sanity check on usable data from a peer (diff)
downloadmonero-7a9ba3f15483e01b55d3138c6cb1a53f344116a3.tar.xz
Merge pull request #7122
3a3370096 protocol: one more sanity check on usable data from a peer (moneromooo-monero)
Diffstat (limited to '')
-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 a60c8f5bb..4fca948a8 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);