Ensure ErrNo is within the limits of Integer to prevent range error when ReadUnsignedInt returns false.

This commit is contained in:
ccrause 2024-02-25 17:34:39 +02:00 committed by Martin
parent 0375bb8ae9
commit d30cfb0a95

View File

@ -3761,8 +3761,10 @@ begin
SizeVal(SizeOf(LongInt)), ErrNo)
then
ExceptName := Format('RunError(%d)', [ErrNo])
else
else begin
ExceptName := 'RunError(unknown)';
ErrNo := 0;
end;
ExceptItem := Exceptions.Find(ExceptName);
if (ExceptItem <> nil) and (ExceptItem.Enabled)
@ -3797,8 +3799,10 @@ begin
SizeVal(SizeOf(Word)), ErrNo)
then
ExceptName := Format('RunError(%d)', [ErrNo])
else
else begin
ExceptName := 'RunError(unknown)';
ErrNo := 0;
end;
ExceptItem := Exceptions.Find(ExceptName);
if (ExceptItem <> nil) and (ExceptItem.Enabled)