Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix S2068 AD0001: Overflow exception when a configuration file value is a number greater than Int32.MaxValue #8310

Closed
mary-georgiou-sonarsource opened this issue Nov 3, 2023 · 0 comments · Fixed by #8312
Assignees
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Type: Bug Exceptions and blocking issues during analysis.
Milestone

Comments

@mary-georgiou-sonarsource
Copy link
Contributor

mary-georgiou-sonarsource commented Nov 3, 2023

Reported by community post.

Description

S2068 raises an AD0001 if one of the configuration values is a number that does not fit in a 32-bit Integer.

Repro steps

Analyze a project with a configuration file AppSetting.json like so:

{
  "AnyField": 2147483648,
}
@mary-georgiou-sonarsource mary-georgiou-sonarsource added the Type: Bug Exceptions and blocking issues during analysis. label Nov 3, 2023
@mary-georgiou-sonarsource mary-georgiou-sonarsource added this to the 9.14 milestone Nov 3, 2023
@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title Fix S2068 AD0001: 'System.OverflowException' exception when the configuration file has a key with the value being a number that is greater than Int32.MaxValue Fix S2068 AD0001: Overflow exception when a configuration file value is a number greater than Int32.MaxValue Nov 3, 2023
@antonioaversa antonioaversa added Area: VB.NET VB.NET rules related issues. Area: C# C# rules related issues. labels Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Area: VB.NET VB.NET rules related issues. Type: Bug Exceptions and blocking issues during analysis.
Projects
None yet
2 participants