浏览代码

* ensure that the ATypeInfo parameter is valid before checking it

Sven/Sarah Barth 2 年之前
父节点
当前提交
574d07041e
共有 1 个文件被更改,包括 1 次插入1 次删除
  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;