mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
C#: Fix potentially concurrent file moves
This commit is contained in:
@@ -33,10 +33,7 @@ namespace Semmle.Util
|
||||
/// <param name="dest">Target file.</param>
|
||||
public static void MoveOrReplace(string src, string dest)
|
||||
{
|
||||
// Potential race condition here.
|
||||
// .net offers the facility to either move a file, or to replace it.
|
||||
File.Delete(dest);
|
||||
File.Move(src, dest);
|
||||
File.Move(src, dest, overwrite: true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user