diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/ResourcesGenerator.cs b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/ResourcesGenerator.cs index 6f31dc30cfc..f78adda7dda 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/ResourcesGenerator.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/ResourcesGenerator.cs @@ -290,7 +290,7 @@ private bool ValidResourceFiles(ITaskItem[] inputFiles) strFileName = inputFile.ItemSpec; - if (!File.Exists(TaskHelper.CreateFullFilePath(strFileName, SourceDir))) + if (!File.Exists(TaskHelper.CreateFullFilePath(strFileName, SourceDir))) // CodeQL [SM00414] Trusted build-time input, not attacker-controlled { bValid = false; Log.LogErrorWithCodeFromResources(nameof(SR.FileNotFound), strFileName); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/UidManager.cs b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/UidManager.cs index 8ef2af92084..eb9c948ba88 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/UidManager.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft/Build/Tasks/Windows/UidManager.cs @@ -243,7 +243,7 @@ private bool ManageUids() using (Stream uidStream = new FileStream(tempFile, FileMode.Create)) { - using (Stream source = File.OpenRead(inputFile.ItemSpec)) + using (Stream source = File.OpenRead(inputFile.ItemSpec)) // CodeQL [SM00414] Trusted build-time input, not attacker-controlled { UidWriter writer = new UidWriter(collector, source, uidStream); writer.UpdateUidWrite(); @@ -297,7 +297,7 @@ private bool ManageUids() using (Stream uidStream = new FileStream(tempFile, FileMode.Create)) { - using (Stream source = File.OpenRead(inputFile.ItemSpec)) + using (Stream source = File.OpenRead(inputFile.ItemSpec)) // CodeQL [SM00414] Trusted build-time input, not attacker-controlled { UidWriter writer = new UidWriter(collector, source, uidStream); writer.RemoveUidWrite(); @@ -371,9 +371,9 @@ private void RenameFile(string src, string dest) private void RemoveFile(string fileName) { - if (File.Exists(fileName)) + if (File.Exists(fileName)) // CodeQL [SM00414] Trusted build-time path, not attacker-controlled { - File.Delete(fileName); + File.Delete(fileName); // CodeQL [SM00414] Trusted build-time path, not attacker-controlled } } @@ -476,7 +476,7 @@ private UidCollector ParseFile(string fileName) { UidCollector collector = new UidCollector(fileName ); - using (Stream xamlStream = File.OpenRead(fileName)) + using (Stream xamlStream = File.OpenRead(fileName)) // CodeQL [SM00414] Trusted build-time input, not attacker-controlled { XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable()); XmlParserContext context = new XmlParserContext(