mirror of
https://github.com/LCEMP/LCEMP.git
synced 2026-06-03 21:17:03 +00:00
fix: add splitscreen, fix dlcs not loading, major RCE vuln fix on packet net, fix chunk loading on non-server clients, persistent saves
note: I changed how XUID works, player data might be wiped on old saves, save items on a chest or similar before trying to load old saves on new version
This commit is contained in:
@@ -51,14 +51,23 @@ void ByteArrayOutputStream::write(byteArray b)
|
||||
//len - the number of bytes to write.
|
||||
void ByteArrayOutputStream::write(byteArray b, unsigned int offset, unsigned int length)
|
||||
{
|
||||
assert( b.length >= offset + length );
|
||||
|
||||
if (offset > b.length || length > b.length - offset)
|
||||
return;
|
||||
|
||||
if (length > 0xFFFFFFFF - count)
|
||||
return;
|
||||
|
||||
// If we will fill the buffer we need to make it bigger
|
||||
if( count + length >= buf.length )
|
||||
buf.resize( max( count + length + 1, buf.length * 2 ) );
|
||||
{
|
||||
unsigned int newSize = (std::max)( count + length + 1, buf.length * 2 );
|
||||
if( newSize <= buf.length )
|
||||
return;
|
||||
buf.resize( newSize );
|
||||
}
|
||||
|
||||
XMemCpy( &buf[count], &b[offset], length );
|
||||
//std::copy( b->data+offset, b->data+offset+length, buf->data + count ); // Or this instead?
|
||||
|
||||
count += length;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user