Fix Convert.FromBase64CharArray with empty array (dotnet/coreclr#10224)
authorStephen Toub <stoub@microsoft.com>
Thu, 16 Mar 2017 04:55:11 +0000 (00:55 -0400)
committerJan Kotas <jkotas@microsoft.com>
Thu, 16 Mar 2017 04:55:11 +0000 (21:55 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/9870e4edc898d24fb5d066b08d1472a03e4c75c5

src/coreclr/src/mscorlib/shared/System/Convert.cs

index ea74fa7..576f78f 100644 (file)
@@ -2713,6 +2713,11 @@ namespace System
 
             Contract.EndContractBlock();
 
+            if (inArray.Length == 0)
+            {
+                return Array.Empty<byte>();
+            }
+
             unsafe
             {
                 fixed (Char* inArrayPtr = &inArray[0])