Fixed RequestExPledgeCrestLarge out of bounds index for byte array.
This commit is contained in:
parent
eddbb43a56
commit
74e32bf28d
@ -47,18 +47,14 @@ public class RequestExPledgeCrestLarge implements IClientIncomingPacket
|
|||||||
{
|
{
|
||||||
for (int i = 0; i <= 4; i++)
|
for (int i = 0; i <= 4; i++)
|
||||||
{
|
{
|
||||||
if (i < 4)
|
final int size = Math.max(Math.min(14336, data.length - (14336 * i)), 0);
|
||||||
|
if (size == 0)
|
||||||
{
|
{
|
||||||
final byte[] fullChunk = new byte[14336];
|
continue;
|
||||||
System.arraycopy(data, (14336 * i), fullChunk, 0, 14336);
|
|
||||||
client.sendPacket(new ExPledgeEmblem(_crestId, fullChunk, _clanId, i));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
final byte[] lastChunk = new byte[8320];
|
|
||||||
System.arraycopy(data, (14336 * i), lastChunk, 0, 8320);
|
|
||||||
client.sendPacket(new ExPledgeEmblem(_crestId, lastChunk, _clanId, i));
|
|
||||||
}
|
}
|
||||||
|
final byte[] chunk = new byte[size];
|
||||||
|
System.arraycopy(data, (14336 * i), chunk, 0, size);
|
||||||
|
client.sendPacket(new ExPledgeEmblem(_crestId, chunk, _clanId, i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,18 +47,14 @@ public class RequestExPledgeCrestLarge implements IClientIncomingPacket
|
|||||||
{
|
{
|
||||||
for (int i = 0; i <= 4; i++)
|
for (int i = 0; i <= 4; i++)
|
||||||
{
|
{
|
||||||
if (i < 4)
|
final int size = Math.max(Math.min(14336, data.length - (14336 * i)), 0);
|
||||||
|
if (size == 0)
|
||||||
{
|
{
|
||||||
final byte[] fullChunk = new byte[14336];
|
continue;
|
||||||
System.arraycopy(data, (14336 * i), fullChunk, 0, 14336);
|
|
||||||
client.sendPacket(new ExPledgeEmblem(_crestId, fullChunk, _clanId, i));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
final byte[] lastChunk = new byte[8320];
|
|
||||||
System.arraycopy(data, (14336 * i), lastChunk, 0, 8320);
|
|
||||||
client.sendPacket(new ExPledgeEmblem(_crestId, lastChunk, _clanId, i));
|
|
||||||
}
|
}
|
||||||
|
final byte[] chunk = new byte[size];
|
||||||
|
System.arraycopy(data, (14336 * i), chunk, 0, size);
|
||||||
|
client.sendPacket(new ExPledgeEmblem(_crestId, chunk, _clanId, i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user