From 6d0ae63be65907e6d77dd7390c346dc6baf6dc89 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 09:12:39 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Clamp=20write=20permission=20are?= =?UTF-8?q?as=20to=20the=20landscape=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The write map trusted area coordinates from the login response and could index a bits array far out of bounds with hostile data. --- Client/ULandscape.pas | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Client/ULandscape.pas b/Client/ULandscape.pas index 5db0e9c..aa1cd5f 100644 --- a/Client/ULandscape.pas +++ b/Client/ULandscape.pas @@ -1327,6 +1327,10 @@ begin y1 := AStream.ReadWord; x2 := AStream.ReadWord; y2 := AStream.ReadWord; + if (x1 >= FCellWidth) or (y1 >= FCellHeight) then + Continue; + if x2 >= FCellWidth then x2 := FCellWidth - 1; + if y2 >= FCellHeight then y2 := FCellHeight - 1; for cellX := x1 to x2 do for cellY := y1 to y2 do FWriteMap[cellX * FCellHeight + cellY] := True;