From 61d3a92ab1c58721a0a541c850a6aaa6c9775aa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Tue, 13 Feb 2024 18:13:02 +0100 Subject: [PATCH] POINSON --- nano/node/transport/socket.cpp | 7 ++++++- nano/node/transport/socket.hpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/nano/node/transport/socket.cpp b/nano/node/transport/socket.cpp index 4acf2253f1..8f3df944de 100644 --- a/nano/node/transport/socket.cpp +++ b/nano/node/transport/socket.cpp @@ -15,6 +15,8 @@ #include +#include + /* * socket */ @@ -22,7 +24,8 @@ nano::transport::socket::socket (nano::node & node_a, endpoint_type_t endpoint_type_a, std::size_t max_queue_size_a) : send_queue{ max_queue_size_a }, strand{ node_a.io_ctx.get_executor () }, - tcp_socket{ node_a.io_ctx }, + tcp_socket_ptr{ std::make_unique (node_a.io_ctx) }, + tcp_socket{ *tcp_socket_ptr }, node{ node_a }, endpoint_type_m{ endpoint_type_a }, timeout{ std::numeric_limits::max () }, @@ -32,6 +35,8 @@ nano::transport::socket::socket (nano::node & node_a, endpoint_type_t endpoint_t silent_connection_tolerance_time{ node_a.network_params.network.silent_connection_tolerance_time }, max_queue_size{ max_queue_size_a } { + __asan_poison_memory_region (poison1.data (), poison1.size ()); + __asan_poison_memory_region (poison2.data (), poison2.size ()); } nano::transport::socket::~socket () diff --git a/nano/node/transport/socket.hpp b/nano/node/transport/socket.hpp index 91f7d008fc..58d73b6794 100644 --- a/nano/node/transport/socket.hpp +++ b/nano/node/transport/socket.hpp @@ -153,7 +153,12 @@ class socket final : public std::enable_shared_from_this strand; - boost::asio::ip::tcp::socket tcp_socket; + + std::array poison1; + std::unique_ptr tcp_socket_ptr; + boost::asio::ip::tcp::socket & tcp_socket; + std::array poison2; + nano::node & node; /** The other end of the connection */