Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Collections.Generic;
Expand Down Expand Up @@ -196,7 +196,8 @@ public static IEnumerable<object[]> EncodeToStringTests_TestData()
}

[Theory]
[InlineData("\u5948cz_T", 0, 0)] // scalar code-path
[InlineData("AB\u1000D", 0, 0)] // scalar code-path, non-ASCII char > 255 (https://github.com/dotnet/runtime/issues/124513)
[InlineData("\u5948cz_T", 0, 0)] // scalar code-path
[InlineData("z_Ta123\u5948", 4, 3)]
[InlineData("\u5948z_T-H7sqEkerqMweH1uSw==", 0, 0)] // Vector128 code-path
[InlineData("z_T-H7sqEkerqMweH1uSw\u5948==", 20, 15)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ internal static unsafe OperationStatus DecodeFrom<TBase64Decoder, T>(TBase64Deco
Debug.Assert(typeof(TBase64Decoder) == typeof(Base64DecoderByte) ? remaining == 4 : remaining < 8);
int i0 = decoder.DecodeRemaining(srcEnd, ref decodingMap, remaining, out uint t2, out uint t3);

if (i0 < 0)
{
goto InvalidDataExit;
}

byte* destMax = destBytes + (uint)destLength;

if (!decoder.IsValidPadding(t3))
Expand Down
Loading