Rce Fix 3

This commit is contained in:
x86 2026-03-08 13:10:17 +13:00 committed by GitHub
parent 5d63f83286
commit 7e3b593053
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,16 +37,24 @@ void TexturePacket::handle(PacketListener *listener)
void TexturePacket::read(DataInputStream *dis) //throws IOException void TexturePacket::read(DataInputStream *dis) //throws IOException
{ {
textureName = dis->readUTF(); textureName = dis->readUTF();
dwBytes = (DWORD)dis->readShort(); short rawBytes = dis->readShort();
if(rawBytes <= 0)
if(dwBytes>0)
{ {
this->pbData= new BYTE [dwBytes]; dwBytes = 0;
return;
}
dwBytes = (DWORD)(unsigned short)rawBytes;
if(dwBytes > 65536)
{
dwBytes = 0;
return;
}
for(DWORD i=0;i<dwBytes;i++) this->pbData= new BYTE [dwBytes];
{
this->pbData[i] = dis->readByte(); for(DWORD i=0;i<dwBytes;i++)
} {
this->pbData[i] = dis->readByte();
} }
} }