Skip to content

Conversation

@GangWang01
Copy link
Member

Fixes - CodeQL isssue dangerous deserialization

Context

CodeQL issue dangerous deserialization below only happens in debug build by checking the code flows. It's safe for release build.
src/MSBuild/CommandLineSwitchException.cs : 20
src/MSBuild/InitializationException.cs : 25
src/Build/Collections/RetrievableEntryHashSet/RetrievableEntryHashSet.cs : 85
src/Build/Errors/InvalidToolsetDefinitionException.cs : 21

Changes Made

Add the comment to suppress the warning.

Copilot AI review requested due to automatic review settings April 17, 2025 03:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR suppresses CodeQL warnings related to dangerous deserialization in debug builds by adding inline comments to affected exception and collection classes.

  • Added suppression comment to InitializationException
  • Added suppression comment to CommandLineSwitchException
  • Added suppression comment to InvalidToolsetDefinitionException
  • Added suppression comment to RetrievableEntryHashSet

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/MSBuild/InitializationException.cs Appended suppression comment to the exception class declaration
src/MSBuild/CommandLineSwitchException.cs Appended suppression comment to the exception class declaration
src/Build/Errors/InvalidToolsetDefinitionException.cs Appended suppression comment to the exception class declaration
src/Build/Collections/RetrievableEntryHashSet/RetrievableEntryHashSet.cs Appended suppression comment to the class declaration in the retrieval hash set

@GangWang01 GangWang01 merged commit f71a751 into dotnet:main Apr 17, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants