From 0a568b45baf1852883630e90ea125786e88f5322 Mon Sep 17 00:00:00 2001 From: Halil Kemal TASKIN Date: Wed, 17 Feb 2021 18:30:05 +0300 Subject: [PATCH] Fix OpenUidBackdoor received data size. Exact size definition for the "received" variable in OpenUidBackdoor function. --- src/MFRC522.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MFRC522.cpp b/src/MFRC522.cpp index a4f70e6..f39451c 100644 --- a/src/MFRC522.cpp +++ b/src/MFRC522.cpp @@ -1717,7 +1717,7 @@ bool MFRC522::MIFARE_OpenUidBackdoor(bool logErrors) { byte validBits = 7; /* Our command is only 7 bits. After receiving card response, this will contain amount of valid response bits. */ byte response[32]; // Card's response is written here - byte received; + byte received = sizeof(response); MFRC522::StatusCode status = PCD_TransceiveData(&cmd, (byte)1, response, &received, &validBits, (byte)0, false); // 40 if(status != STATUS_OK) { if(logErrors) {