diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-12-10 22:59:15 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-12-10 23:02:06 +0000 |
commit | cd7e9769d85054f91e1e852519c11f09b80e48a3 (patch) | |
tree | c77557e04fca3073b626a0d4751b0a3809edb6a5 | |
parent | Merge pull request #7108 (diff) | |
download | monero-cd7e9769d85054f91e1e852519c11f09b80e48a3.tar.xz |
protocol: one more sanity check on usable data from a peer
-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 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); |