Skip to content

Commit

Permalink
Lucene.Net.Support.IO.FileSupport::GetFileIOExceptionHResult(): Avoid…
Browse files Browse the repository at this point in the history
… Path.GetTempFileName() because it is not secure. https://rules.sonarsource.com/csharp/RSPEC-5445
  • Loading branch information
NightOwl888 committed Nov 1, 2022
1 parent ada8990 commit 4166765
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Lucene.Net/Support/IO/FileSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal static class FileSupport
try
{
// This could throw, but we don't care about this HResult value.
fileName = Path.GetTempFileName();
fileName = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); // LUCENENET NOTE: Path.GetTempFileName() is considered insecure because the filename can be guessed https://rules.sonarsource.com/csharp/RSPEC-5445
}
catch
{
Expand Down

0 comments on commit 4166765

Please sign in to comment.