Browse Source

* ensure that the ATypeInfo parameter is valid before checking it

Sven/Sarah Barth 2 years ago
parent
commit
574d07041e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/rtl-generics/src/generics.defaults.pas

+ 1 - 1
packages/rtl-generics/src/generics.defaults.pas

@@ -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;