Skip to content

Commit

Permalink
Update MFRC522Extended.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamsurve10 authored Nov 14, 2024
1 parent d5dba13 commit 0f023e1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MFRC522Extended.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ MFRC522::StatusCode MFRC522Extended::TCL_Transceive(TagInfo *tag, byte *sendData
// Swap block number on success
tag->blockNumber = !tag->blockNumber;

if (backData && (backLen > 0)) {
if (backData && (backLen != nullptr && *backLen > 0)) {
if (*backLen < in.inf.size)
return STATUS_NO_ROOM;

Expand All @@ -844,7 +844,7 @@ MFRC522::StatusCode MFRC522Extended::TCL_Transceive(TagInfo *tag, byte *sendData
if (result != STATUS_OK)
return result;

if (backData && (backLen > 0)) {
if (backData && (backLen != nullptr && *backLen > 0)) {
if ((*backLen + ackDataSize) > totalBackLen)
return STATUS_NO_ROOM;

Expand Down

0 comments on commit 0f023e1

Please sign in to comment.