Skip to content
Merged
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
4 changes: 2 additions & 2 deletions src/devices/Card/Ndef/NdefMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public static (int Start, int Size) GetStartSizeNdef(Span<byte> toExtract)
public static byte[]? ExtractMessage(Span<byte> toExtract)
{
var (idx, size) = GetStartSizeNdef(toExtract);
// Finally check that the end terminator TLV is 0xFE
bool isRealEnd = toExtract[idx + size] == 0xFE;
// Finally check that the optional end terminator TLV is 0xFE
bool isRealEnd = (toExtract.Length == idx + size) || (toExtract[idx + size] == 0xFE);
if (!isRealEnd)
{
return new byte[0];
Expand Down