C#: ZipSlip - Add spaces into bad example.

This commit is contained in:
Luke Cartey
2018-08-21 13:06:29 +01:00
parent 6453153393
commit 4f57456df1
2 changed files with 3 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ class Good
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 of the target dir: " +
throw new System.InvalidOperationException("Entry is outside of the target dir: " +
destFileName);
}
entry.ExtractToFile(destFileName);

View File

@@ -9,9 +9,9 @@ class Good
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 of the target dir: " +
throw new System.InvalidOperationException("Entry is outside of the target dir: " +
destFileName);
}
entry.ExtractToFile(destFileName);
}
}
}