mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-03-22 11:18:13 +05:00
LCEMP RCE fixes
Based on commit d017bfc30a68888bf5c79b23cf5c4f607cf828bf
This commit is contained in:
@@ -37,17 +37,26 @@ void TexturePacket::handle(PacketListener *listener)
|
||||
void TexturePacket::read(DataInputStream *dis) //throws IOException
|
||||
{
|
||||
textureName = dis->readUTF();
|
||||
dwBytes = static_cast<DWORD>(dis->readShort());
|
||||
short rawBytes = dis->readShort();
|
||||
if (rawBytes <= 0)
|
||||
{
|
||||
dwBytes = 0;
|
||||
return;
|
||||
}
|
||||
dwBytes = (DWORD)(unsigned short)rawBytes;
|
||||
if (dwBytes > 65536)
|
||||
{
|
||||
dwBytes = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
this->pbData= new BYTE [dwBytes];
|
||||
|
||||
if(dwBytes>0)
|
||||
for(DWORD i=0;i<dwBytes;i++)
|
||||
{
|
||||
this->pbData= new BYTE [dwBytes];
|
||||
|
||||
for(DWORD i=0;i<dwBytes;i++)
|
||||
{
|
||||
this->pbData[i] = dis->readByte();
|
||||
}
|
||||
this->pbData[i] = dis->readByte();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void TexturePacket::write(DataOutputStream *dos) //throws IOException
|
||||
|
||||
Reference in New Issue
Block a user