Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 536a1c1

Browse files
stephentoubsafern
authored andcommitted
Fix Convert.FromBase64CharArray with empty array (dotnet/coreclr#10224)
Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
1 parent 4b67bf4 commit 536a1c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Common/src/CoreLib/System/Convert.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2713,6 +2713,11 @@ public static Byte[] FromBase64CharArray(Char[] inArray, Int32 offset, Int32 len
27132713

27142714
Contract.EndContractBlock();
27152715

2716+
if (inArray.Length == 0)
2717+
{
2718+
return Array.Empty<byte>();
2719+
}
2720+
27162721
unsafe
27172722
{
27182723
fixed (Char* inArrayPtr = &inArray[0])

0 commit comments

Comments
 (0)