mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-12 04:03:53 +00:00
LCEMP RCE fixes
Based on commit d017bfc30a68888bf5c79b23cf5c4f607cf828bf
This commit is contained in:
parent
0c4f459904
commit
d557ca2dfb
27 changed files with 222 additions and 80 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue