🐛 Stop block requests with no coordinates from crashing
A truncated request packet produced an empty coordinate array whose first element was dereferenced.
This commit is contained in:
@@ -182,6 +182,7 @@ var
|
||||
begin
|
||||
if not ValidateAccess(ANetState, alView) then Exit;
|
||||
SetLength(coords, (ABuffer.Size - ABuffer.Position) div SizeOf(TBlockCoords));
|
||||
if Length(coords) = 0 then Exit;
|
||||
ABuffer.Read(coords[0], Length(coords) * SizeOf(TBlockCoords));
|
||||
CEDServerInstance.SendPacket(ANetState, TCompressedPacket.Create(TBlockPacket.Create(coords, ANetState)));
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user