Skip to content

Commit

Permalink
#36: fix for .. as well
Browse files Browse the repository at this point in the history
  • Loading branch information
chucker committed Jul 10, 2023
1 parent 532add4 commit 3bf3f73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TRENZ.Docs.API/Models/Sources/AbstractFilesystemSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public IEnumerable<ISourceFile> FindFiles(Regex pattern)
{
var combinedRoot = FSPath.Combine(Root, Path);

if (combinedRoot.Length < Root.Length)
if (FSPath.GetFullPath(combinedRoot).Length < Root.Length)
throw new SecurityException(ExceptionMessages.PreventedPathTraversal);

return IterateDirectory(pattern, combinedRoot, combinedRoot);
Expand Down

0 comments on commit 3bf3f73

Please sign in to comment.