From e74065fd49e7734b1fb941478c4dc428d61dd049 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 14:43:49 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Reject=20out-of-range=20block=20?= =?UTF-8?q?subscriptions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The off-by-one bounds check let a crafted free-block packet index one past the subscription array and follow garbage memory as a client list, corrupting the heap. --- Server/ULandscape.pas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Server/ULandscape.pas b/Server/ULandscape.pas index f9b8d50..bf18df4 100644 --- a/Server/ULandscape.pas +++ b/Server/ULandscape.pas @@ -373,7 +373,7 @@ end; function TLandscape.GetBlockSubscriptions(AX, AY: Word): TLinkedList; begin - if (AX >= 0) and (AX <= FWidth) and (AY >= 0) and (AY <= FHeight) then + if (AX < FWidth) and (AY < FHeight) then Result := FBlockSubscriptions[(AY * FWidth) + AX] else Result := nil; @@ -384,7 +384,7 @@ var block: TMapBlock; begin Result := nil; - if (AX >= 0) and (AX <= FCellWidth) and (AY >= 0) and (AY <= FCellHeight) then + if (AX < FCellWidth) and (AY < FCellHeight) then begin block := GetMapBlock(AX div 8, AY div 8); if block <> nil then @@ -405,7 +405,7 @@ var block: TSeperatedStaticBlock; begin Result := nil; - if (AX >= 0) and (AX <= FCellWidth) and (AY >= 0) and (AY <= FCellHeight) then + if (AX < FCellWidth) and (AY < FCellHeight) then begin block := GetStaticBlock(AX div 8, AY div 8); if block <> nil then