diff options
author | Alexander Blair <snipa@jagtech.io> | 2020-12-10 17:44:54 -0800 |
---|---|---|
committer | Alexander Blair <snipa@jagtech.io> | 2020-12-10 17:44:54 -0800 |
commit | 0f6756927929d44f62fa4301a22c584223552d98 (patch) | |
tree | 143b0eb45dc3d8061f8cc584d380111dd2098ec0 /src | |
parent | Merge pull request #7117 (diff) | |
parent | protocol: one more sanity check on usable data from a peer (diff) | |
download | monero-0f6756927929d44f62fa4301a22c584223552d98.tar.xz |
Merge pull request #7121
cd7e9769d protocol: one more sanity check on usable data from a peer (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptonote_protocol/cryptonote_protocol_handler.inl | 2 |
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); |