mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
fix bounds check in GetLinkSitingAvatar
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user