🚨 Clamp write permission areas to the landscape size

The write map trusted area coordinates from the login response and
could index a bits array far out of bounds with hostile data.
This commit is contained in:
2026-11-15 22:06:51 +01:00
parent fa288fddf8
commit 6d0ae63be6
+4
View File
@@ -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;