fix(Core/Server): Add bytebuffer exception handling to addoninfo read (#21500)
This commit is contained in:
@@ -1146,6 +1146,8 @@ void WorldSession::ReadAddonsInfo(ByteBuffer& data)
|
|||||||
addonInfo.resize(size);
|
addonInfo.resize(size);
|
||||||
|
|
||||||
if (uncompress(addonInfo.contents(), &uSize, data.contents() + pos, data.size() - pos) == Z_OK)
|
if (uncompress(addonInfo.contents(), &uSize, data.contents() + pos, data.size() - pos) == Z_OK)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
uint32 addonsCount;
|
uint32 addonsCount;
|
||||||
addonInfo >> addonsCount; // addons count
|
addonInfo >> addonsCount; // addons count
|
||||||
@@ -1199,6 +1201,11 @@ void WorldSession::ReadAddonsInfo(ByteBuffer& data)
|
|||||||
if (addonInfo.rpos() != addonInfo.size())
|
if (addonInfo.rpos() != addonInfo.size())
|
||||||
LOG_DEBUG("network", "packet under-read!");
|
LOG_DEBUG("network", "packet under-read!");
|
||||||
}
|
}
|
||||||
|
catch (ByteBufferException const& e)
|
||||||
|
{
|
||||||
|
LOG_ERROR("network", "Addon packet read error! {}", e.what());
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
LOG_ERROR("network", "Addon packet uncompress error!");
|
LOG_ERROR("network", "Addon packet uncompress error!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user