* ensure that the ATypeInfo parameter is valid before checking it

This commit is contained in:
Sven/Sarah Barth 2023-06-30 16:26:16 +02:00
parent 8592d42afa
commit 574d07041e

View File

@ -3382,7 +3382,7 @@ end;
function _LookupVtableInfoEx(AGInterface: TDefaultGenericInterface; ATypeInfo: PTypeInfo; ASize: SizeInt;
AFactory: THashFactoryClass): Pointer;
begin
if ATypeInfo^.Kind in TComparerService.UseBinaryMethods then begin
if not Assigned(ATypeInfo) or (ATypeInfo^.Kind in TComparerService.UseBinaryMethods) then begin
System.Error(reInvalidCast);
Exit(Nil);
end;