From a0369e38d52367d10b7cc03b294cec01934c6d9d Mon Sep 17 00:00:00 2001 From: Wesley Shillingford Date: Fri, 22 Feb 2019 10:31:54 +0000 Subject: [PATCH] Check that full() in udf_buffer is not empty and assert (#1753) --- nano/node/node.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nano/node/node.cpp b/nano/node/node.cpp index e0e82b09..3b47d7f7 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -3853,12 +3853,13 @@ nano::udp_data * nano::udp_buffer::allocate () result = free.front (); free.pop_front (); } - if (result == nullptr) + if (result == nullptr && !full.empty ()) { result = full.front (); full.pop_front (); stats.inc (nano::stat::type::udp, nano::stat::detail::overflow, nano::stat::dir::in); } + release_assert (result || stopped); return result; } void nano::udp_buffer::enqueue (nano::udp_data * data_a)