mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
C#: ZipSlip - Add spaces into bad example.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user