Skip to content

Commit

Permalink
Skip bundle entries that do not contain a plain relative path.
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedpammer committed Dec 5, 2022
1 parent 6855f58 commit 2a47bef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ICSharpCode.ILSpyCmd/IlspyCmdProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ int DumpPackageAssemblies(string packageFileName, string outputDirectory, Comman
{
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);
Expand Down

0 comments on commit 2a47bef

Please sign in to comment.