Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,13 @@ public async Task<IActionResult> OnPostAnalyzeMessagesAsync()
return RedirectToPage();
}

public static void WriteToDirectory(ZipArchiveEntry entry, string destDirectory)
public static void WriteToDirectory(ZipArchiveEntry entry, string destDirectory)
{
string destFileName = Path.Combine(destDirectory, entry.FullName);
string destFileName = Path.GetFullPath(Path.Combine(destDirectory, entry.FullName));
string fullDestDirPath = Path.GetFullPath(destDirectory + Path.DirectorySeparatorChar);
if (!destFileName.StartsWith(fullDestDirPath)) {
throw new System.InvalidOperationException("Entry is outside the target dir: " + destFileName);
}
entry.ExtractToFile(destFileName);
}
}
Expand Down
Loading