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

[Fuzzing] AssemblyNameInfoFuzzer: CultureNotFoundException: Culture is not supported #107949

Closed
MihaZupan opened this issue Sep 17, 2024 · 5 comments · Fixed by #108053
Closed
Assignees
Labels
area-System.Reflection.Metadata binaryformatter-migration Issues related to the removal of BinaryFormatter and migrations away from it in-pr There is an active PR which will close this issue when it is merged
Milestone

Comments

@MihaZupan
Copy link
Member

System.Globalization.CultureNotFoundException: Culture is not supported. (Parameter 'name')
aaaA is an invalid culture identifier.
   at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride)
   at System.Reflection.AssemblyName.set_CultureName(String value)
   at System.Reflection.Metadata.AssemblyNameInfo.ToAssemblyName()
   at DotnetFuzzing.Fuzzers.AssemblyNameInfoFuzzer.Test(Span`1 span) in D:\a\_work\1\s\src\libraries\Fuzzing\DotnetFuzzing\Fuzzers\AssemblyNameInfoFuzzer.cs:line 44
   at DotnetFuzzing.Fuzzers.AssemblyNameInfoFuzzer.FuzzTarget(ReadOnlySpan`1 bytes) in D:\a\_work\1\s\src\libraries\Fuzzing\DotnetFuzzing\Fuzzers\AssemblyNameInfoFuzzer.cs:line 27
   at DotnetFuzzing.Program.<>c__DisplayClass1_0.b__0(ReadOnlySpan`1 bytes) in D:\a\_work\1\s\src\libraries\Fuzzing\DotnetFuzzing\Program.cs:line 91
   at SharpFuzz.Fuzzer.LibFuzzer.Run(ReadOnlySpanAction action, Boolean ignoreExceptions)

Input: sibP,culture=aaaA

cc: @adamsitnik @buyaa-n

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Sep 17, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-reflection-metadata
See info in area-owners.md if you want to be subscribed.

@ericstj ericstj added binaryformatter-migration Issues related to the removal of BinaryFormatter and migrations away from it and removed untriaged New issue has not been triaged by the area owner labels Sep 19, 2024
@ericstj ericstj added this to the 9.0.0 milestone Sep 19, 2024
Copy link
Contributor

Tagging subscribers to 'binaryformatter-migration': @adamsitnik, @bartonjs, @jeffhandley, @terrajobst

@ericstj
Copy link
Member

ericstj commented Sep 19, 2024

@adamsitnik I'm guessing this is by-design? AssemblyName represents the Culture as a CultureInfo so feeding in a bogus value here will cause it to throw. Are there any side effects from this that would warrant it being a bug and not "by-design"?

@adamsitnik
Copy link
Member

We just need to make sure this scenario is recognized properly (all unexpected exceptions are treated as bugs)

@ericstj
Copy link
Member

ericstj commented Sep 19, 2024

I see, so you need to add a catch here to indicate you expect a CultureNotFoundException:

catch (System.Security.SecurityException)

@dotnet-policy-service dotnet-policy-service bot added the in-pr There is an active PR which will close this issue when it is merged label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Reflection.Metadata binaryformatter-migration Issues related to the removal of BinaryFormatter and migrations away from it in-pr There is an active PR which will close this issue when it is merged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants