add wearables array size checks on unpack

This commit is contained in:
UbitUmarov
2014-08-08 01:32:16 +01:00
parent 95f0d582a5
commit c6cdd597f3
2 changed files with 18 additions and 3 deletions

View File

@@ -657,7 +657,12 @@ namespace OpenSim.Framework
if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array)
{
OSDArray wears = (OSDArray)(args["wearables"]);
for (int i = 0; i < wears.Count / 2; i++)
int count = wears.Count;
if (count > AvatarWearable.MAX_WEARABLES)
count = AvatarWearable.MAX_WEARABLES;
for (int i = 0; i < count / 2; i++)
{
AvatarWearable awear = new AvatarWearable((OSDArray)wears[i]);
Appearance.SetWearable(i,awear);