FIX: Don't follow cyclic symbolic links

This commit is contained in:
Alexander Koblov 2023-05-06 14:35:25 +03:00
commit 9d96e3116a

View file

@ -331,7 +331,7 @@ var
AddedIndex: Integer;
begin
LinkedFilePath := mbReadAllLinks(aFile.FullPath);
if (LinkedFilePath <> '') and (LinkedFilePath <> PathDelim) then
if (LinkedFilePath <> '') and not (aFile.IsLinkToDirectory and IsInPath(LinkedFilePath, aFile.FullPath, True, True)) then
begin
try
LinkedFile := TFileSystemFileSource.CreateFileFromFile(LinkedFilePath);