Browse Source

Skip bundle entries that do not contain a plain relative path.

pull/2863/head
Siegfried Pammer 2 years ago
parent
commit
2a47bef99a
  1. 6
      ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs

6
ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs

@ -342,6 +342,12 @@ Examples: @@ -342,6 +342,12 @@ Examples:
{
Stream contents;
if (entry.RelativePath.Replace('\\', '/').Contains("../", StringComparison.Ordinal))
{
app.Error.WriteLine($"Skipping single-file entry '{entry.RelativePath}' because it might refer to a location outside of the bundle output directory.");
continue;
}
if (entry.CompressedSize == 0)
{
contents = new UnmanagedMemoryStream(packageView.SafeMemoryMappedViewHandle, entry.Offset, entry.Size);

Loading…
Cancel
Save