fix(Core/Server): Add bytebuffer exception handling to addoninfo read (#21500)

This commit is contained in:
Takenbacon
2025-02-18 03:15:59 -08:00
committed by GitHub
parent 58d13e69e1
commit 854ebc8025
+7
View File
@@ -1146,6 +1146,8 @@ void WorldSession::ReadAddonsInfo(ByteBuffer& data)
addonInfo.resize(size);
if (uncompress(addonInfo.contents(), &uSize, data.contents() + pos, data.size() - pos) == Z_OK)
{
try
{
uint32 addonsCount;
addonInfo >> addonsCount; // addons count
@@ -1199,6 +1201,11 @@ void WorldSession::ReadAddonsInfo(ByteBuffer& data)
if (addonInfo.rpos() != addonInfo.size())
LOG_DEBUG("network", "packet under-read!");
}
catch (ByteBufferException const& e)
{
LOG_ERROR("network", "Addon packet read error! {}", e.what());
}
}
else
LOG_ERROR("network", "Addon packet uncompress error!");
}