Skip to content

Commit cdc2677

Browse files
author
Michael Haberler
committed
Added fix for "When the text record on tag is longer than 259 bytes t… don#61
from don@3286f72 crashes in NdefMessage without this fix
1 parent c30b6d0 commit cdc2677

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/NdefMessage.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ NdefMessage::NdefMessage(const byte *data, const uint16_t numBytes)
3838
int typeLength = data[index];
3939

4040
uint32_t payloadLength = 0;
41+
index++;
4142
if (sr)
4243
{
43-
index++;
4444
payloadLength = data[index];
4545
}
4646
else
4747
{
4848
payloadLength =
4949
(static_cast<uint32_t>(data[index]) << 24) | (static_cast<uint32_t>(data[index + 1]) << 16) | (static_cast<uint32_t>(data[index + 2]) << 8) | static_cast<uint32_t>(data[index + 3]);
50-
index += 4;
50+
index += 3;
5151
}
5252

5353
int idLength = 0;

0 commit comments

Comments
 (0)