fix bounds check in GetLinkSitingAvatar

This commit is contained in:
UbitUmarov
2023-03-11 17:38:06 +00:00
parent b3f876b9a3
commit 6d22429329
2 changed files with 4 additions and 4 deletions

View File

@@ -5285,10 +5285,10 @@ namespace OpenSim.Region.Framework.Scenes
{
lock(m_parts)
linknumber -= (m_parts.Count + 1);
if(linknumber >= 0)
lock (m_sittingAvatars)
{
lock (m_sittingAvatars)
return linknumber > m_sittingAvatars.Count ? null : m_sittingAvatars[linknumber];
if (linknumber >= 0 && linknumber < m_sittingAvatars.Count)
return m_sittingAvatars[linknumber];
}
return null;
}

View File

@@ -5704,7 +5704,7 @@ namespace OpenSim.Region.Framework.Scenes
if (AnimationsNames.Count == 0)
return new byte[] { 0 };
using (MemoryStream ms = new MemoryStream())
using (MemoryStream ms = new())
{
byte[] tmp = Utils.UInt16ToBytes((ushort)Animations.Count);
ms.Write(tmp, 0, 2);