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
2018-04-27 21:25:14 +02:00
parent 8cec3ffe43
commit 9fb11fc8f2

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();