Skip to content

Commit 4f57456

Browse files
committed
C#: ZipSlip - Add spaces into bad example.
1 parent 6453153 commit 4f57456

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

csharp/ql/src/Security Features/CWE-022/ZipSlipGood.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public static void WriteToDirectory(ZipArchiveEntry entry,
99
string destFileName = Path.GetFullPath(Path.Combine(destDirectory, entry.FullName));
1010
string fullDestDirPath = Path.GetFullPath(destDirectory + Path.DirectorySeparatorChar);
1111
if (!destFileName.StartsWith(fullDestDirPath)) {
12-
throw new System.InvalidOperationException("Entry is outside of the target dir: " +
12+
throw new System.InvalidOperationException("Entry is outside of the target dir: " +
1313
destFileName);
1414
}
1515
entry.ExtractToFile(destFileName);

csharp/ql/test/query-tests/Security Features/CWE-022/ZipSlip/ZipSlipGood.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public static void WriteToDirectory(ZipArchiveEntry entry,
99
string destFileName = Path.GetFullPath(Path.Combine(destDirectory, entry.FullName));
1010
string fullDestDirPath = Path.GetFullPath(destDirectory + Path.DirectorySeparatorChar);
1111
if (!destFileName.StartsWith(fullDestDirPath)) {
12-
throw new System.InvalidOperationException("Entry is outside of the target dir: " +
12+
throw new System.InvalidOperationException("Entry is outside of the target dir: " +
1313
destFileName);
1414
}
1515
entry.ExtractToFile(destFileName);
1616
}
17-
}
17+
}

0 commit comments

Comments
 (0)