mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user