Dep/Boost: Fix crash in Boost

Work around a NULL dereference exception happening in boost::asio::ip::tcp::resolver::results_type, resulting in a crash when trying to bind on an address that cannot be resolved.
Fixes #21884
This commit is contained in:
jackpoz authored and Aokromes committed 2018-04-29 17:46:44 +02:00
1 parent e6d8b0842b
commit 7df6a6bbcb
1 file changed
+1 -1
+1 -1
View File
@@ -32,7 +32,7 @@ namespace Trinity
boost::system::error_code ec;
#if BOOST_VERSION >= 106600
boost::asio::ip::tcp::resolver::results_type results = resolver.resolve(protocol, host, service, ec);
if (results.empty() || ec)
if (results.begin() == results.end() || ec)
return {};
return results.begin()->endpoint();