From f09b8b7fbc68722d10f5fa11ab1188372715171a Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 15 Nov 2026 09:29:35 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Validate=20radar=20map=20packet?= =?UTF-8?q?=20payloads?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit An empty radar map indexed an empty array, and update coordinates from the server were written into the image without bounds checks. --- Client/UfrmRadar.pas | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Client/UfrmRadar.pas b/Client/UfrmRadar.pas index bca1523..4dd6304 100644 --- a/Client/UfrmRadar.pas +++ b/Client/UfrmRadar.pas @@ -217,7 +217,8 @@ begin $02: //radar map begin SetLength(radarMap, (ABuffer.Size - ABuffer.Position) div SizeOf(Word)); - ABuffer.Read(radarMap[0], Length(radarMap) * SizeOf(Word)); + if Length(radarMap) > 0 then + ABuffer.Read(radarMap[0], Length(radarMap) * SizeOf(Word)); RefreshRadar(radarMap); //frmMain.Enabled := True; frmInitialize.UnsetModal; @@ -227,8 +228,11 @@ begin begin x := ABuffer.ReadWord; y := ABuffer.ReadWord; - PInteger(FRadar.PixelPointer[x, y])^ := DecodeUOColor(ABuffer.ReadWord); - RepaintRadar; + if (x < FRadar.Width) and (y < FRadar.Height) then + begin + PInteger(FRadar.PixelPointer[x, y])^ := DecodeUOColor(ABuffer.ReadWord); + RepaintRadar; + end; end; end; end;