mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
Resolve CA5389
This commit is contained in:
parent
89d41e7cb3
commit
69a12fadcf
2 changed files with 5 additions and 2 deletions
|
@ -115,7 +115,6 @@ dotnet_diagnostic.ca1028.severity = silent
|
|||
dotnet_diagnostic.ca1031.severity = silent
|
||||
|
||||
# TODO - one at a time
|
||||
dotnet_diagnostic.ca5389.severity = silent
|
||||
dotnet_diagnostic.ca5392.severity = silent
|
||||
dotnet_diagnostic.ca5394.severity = silent
|
||||
|
||||
|
|
|
@ -1004,7 +1004,11 @@ namespace ArchiSteamFarm {
|
|||
|
||||
// Now enumerate over files in the zip archive, skip directory entries that we're not interested in (we can create them ourselves if needed)
|
||||
foreach (ZipArchiveEntry zipFile in archive.Entries.Where(zipFile => !string.IsNullOrEmpty(zipFile.Name))) {
|
||||
string file = Path.Combine(targetDirectory, zipFile.FullName);
|
||||
string file = Path.GetFullPath(Path.Combine(targetDirectory, zipFile.FullName));
|
||||
|
||||
if (!file.StartsWith(targetDirectory, StringComparison.Ordinal)) {
|
||||
throw new InvalidOperationException(nameof(file));
|
||||
}
|
||||
|
||||
if (File.Exists(file)) {
|
||||
// This is possible only with files that we decided to leave in place during our backup function
|
||||
|
|
Loading…
Reference in a new issue