mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
ConnectionArray list index access bug fixed where index == count would be allowed
This commit is contained in:
parent
e505cbd5f4
commit
c41ca4d824
@ -56,7 +56,7 @@ public NetworkConnection Get(int connId)
|
||||
return m_LocalConnections[Mathf.Abs(connId) - 1];
|
||||
}
|
||||
|
||||
if (connId < 0 || connId > m_Connections.Count)
|
||||
if (connId >= connections.Count)
|
||||
{
|
||||
if (LogFilter.logWarn) { Debug.LogWarning("ConnectionArray Get invalid index " + connId); }
|
||||
return null;
|
||||
@ -68,7 +68,7 @@ public NetworkConnection Get(int connId)
|
||||
// call this if the connection may not exist (in disconnect handler)
|
||||
public NetworkConnection GetUnsafe(int connId)
|
||||
{
|
||||
if (connId < 0 || connId > m_Connections.Count)
|
||||
if (connId < 0 || connId >= m_Connections.Count)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@ -83,7 +83,7 @@ public void Remove(int connId)
|
||||
return;
|
||||
}
|
||||
|
||||
if (connId < 0 || connId > m_Connections.Count)
|
||||
if (connId < 0 || connId >= m_Connections.Count)
|
||||
{
|
||||
if (LogFilter.logWarn) { Debug.LogWarning("ConnectionArray Remove invalid index " + connId); }
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user