aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-11-29 01:54:08 -0600
committerluigi1111 <luigi1111w@gmail.com>2020-11-29 01:54:08 -0600
commita92b968e357810a2f9b83827d44df744406b0321 (patch)
tree143f648cb45fcaa63ad4cb43f4e5f483477fbc5a /src
parentMerge pull request #6960 (diff)
parentprotocol: reject empty incoming block messages (diff)
downloadmonero-a92b968e357810a2f9b83827d44df744406b0321.tar.xz
Merge pull request #6971
f9527e6 protocol: reject empty incoming block messages (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index a8073e091..20bcd7f3b 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -1091,6 +1091,13 @@ namespace cryptonote
//epee::net_utils::network_throttle_manager::get_global_throttle_inreq().logger_handle_net("log/dr-monero/net/req-all.data", sec, get_avg_block_size());
+ if(arg.blocks.empty())
+ {
+ LOG_ERROR_CCONTEXT("sent wrong NOTIFY_HAVE_OBJECTS: no blocks");
+ drop_connection(context, true, false);
+ ++m_sync_bad_spans_downloaded;
+ return 1;
+ }
if(context.m_last_response_height > arg.current_blockchain_height)
{
LOG_ERROR_CCONTEXT("sent wrong NOTIFY_HAVE_OBJECTS: arg.m_current_blockchain_height=" << arg.current_blockchain_height