From ed555be1804b9f98d59351541a16ee171939d2a8 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 5 May 2023 13:18:53 +0200 Subject: [PATCH] fix wrong copying when skipping sector trailers --- client/src/mifare/mifarehost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/mifare/mifarehost.c b/client/src/mifare/mifarehost.c index 9e9f674e1..3b37182fe 100644 --- a/client/src/mifare/mifarehost.c +++ b/client/src/mifare/mifarehost.c @@ -1467,12 +1467,12 @@ int convert_mfc_2_arr(uint8_t *in, uint16_t ilen, uint8_t *out, uint16_t *olen) if (mfIsSectorTrailer(blockno) == false) { memcpy(out, in, MFBLOCK_SIZE); + out += MFBLOCK_SIZE; + *olen += MFBLOCK_SIZE; } blockno++; - out += MFBLOCK_SIZE; in += MFBLOCK_SIZE; ilen -= MFBLOCK_SIZE; - *olen += MFBLOCK_SIZE; } return PM3_SUCCESS; }