diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/JapaneseCalendar.Nls.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/JapaneseCalendar.Nls.cs index a65f5c5cb1452..1ae65aa57432d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/JapaneseCalendar.Nls.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/JapaneseCalendar.Nls.cs @@ -196,7 +196,7 @@ private static int CompareEraRanges(EraInfo a, EraInfo b) ReadOnlySpan eraName = dataSpan[names[0]]; ReadOnlySpan abbreviatedEraName = dataSpan[names[1]]; ReadOnlySpan englishEraName = dataSpan[names[2]]; - ReadOnlySpan abbreviatedEnglishEraName = dataSpan[names[2]]; + ReadOnlySpan abbreviatedEnglishEraName = dataSpan[names[3]]; // Each part should have data in it if (!eraName.IsEmpty && !abbreviatedEraName.IsEmpty && !englishEraName.IsEmpty && !abbreviatedEnglishEraName.IsEmpty) diff --git a/src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyNameParser.cs b/src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyNameParser.cs index 497ff718f8cf9..dae42bc06496d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyNameParser.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Reflection/AssemblyNameParser.cs @@ -193,7 +193,7 @@ private Version ParseVersion(string attributeValue) ReadOnlySpan attributeValueSpan = attributeValue; Span parts = stackalloc Range[5]; parts = parts.Slice(0, attributeValueSpan.Split(parts, '.')); - if (parts.Length is not (3 or 4)) + if (parts.Length is < 2 or > 4) { ThrowInvalidAssemblyName(); }