mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 07:46:00 +02:00
Check that index value is not below lower bound in TMessage.Valid method
This commit is contained in:
parent
f417c87ec8
commit
c6c05f8395
@ -461,8 +461,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TMessage.Valid(nr:longint):boolean;
|
function TMessage.Valid(nr:longint):boolean;
|
||||||
|
var
|
||||||
|
i,j : longint;
|
||||||
begin
|
begin
|
||||||
result:=(nr div 1000<msgparts) and (nr mod 1000<msgidxmax[nr div 1000]) and assigned(msgidx[nr div 1000]^[nr mod 1000]);
|
i:=nr div 1000;
|
||||||
|
j:=nr mod 1000;
|
||||||
|
result:=(i>=low(msgstates)) and (i<msgparts) and (j<msgidxmax[i]) and assigned(msgidx[i]^[j]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TMessage.ResetStates;
|
procedure TMessage.ResetStates;
|
||||||
|
Loading…
Reference in New Issue
Block a user