🐛 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:
2026-11-15 22:08:32 +01:00
parent e12fe942b7
commit 46aaec645c
+1
View File
@@ -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;