From 74650f94c1da3292de02d46bd1d7fcf0505ea840 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Thu, 29 Jul 2021 18:44:46 +0300 Subject: [PATCH 1/2] coverity --- client/src/mifare/desfirecore.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/mifare/desfirecore.c b/client/src/mifare/desfirecore.c index befcc37a5..66d027306 100644 --- a/client/src/mifare/desfirecore.c +++ b/client/src/mifare/desfirecore.c @@ -415,7 +415,7 @@ static int DesfireExchangeNative(bool activate_field, DesfireContext *ctx, uint8 sentdatalen += len; if (rcode != MFDES_ADDITIONAL_FRAME || buflen > 0) { if (sentdatalen != cdatalen) - PrintAndLogEx(WARNING, "Tx chaining error. Needs to send: %d but sent: %d", cdatalen, sentdatalen); + PrintAndLogEx(WARNING, "Tx chaining error. Needs to send: %d but sent: %zu", cdatalen, sentdatalen); break; } } @@ -517,7 +517,7 @@ static int DesfireExchangeISO(bool activate_field, DesfireContext *ctx, uint8_t sentdatalen += apdu.Lc; if (sw != DESFIRE_GET_ISO_STATUS(MFDES_ADDITIONAL_FRAME) || buflen > 0) { if (sentdatalen != datalen) - PrintAndLogEx(WARNING, "Tx chaining error. Needs to send: %d but sent: %d", datalen, sentdatalen); + PrintAndLogEx(WARNING, "Tx chaining error. Needs to send: %zu but sent: %zu", datalen, sentdatalen); break; } } @@ -1171,7 +1171,7 @@ int DesfireFillFileList(DesfireContext *dctx, FileListS FileList, size_t *filesc if (isoindx > 0) isoindx--; if (isoindx * 2 != buflen) - PrintAndLogEx(WARNING, "Wrong ISO ID list length. must be %d but %d", buflen, isoindx * 2); + PrintAndLogEx(WARNING, "Wrong ISO ID list length. must be %zu but %zu", buflen, isoindx * 2); } else { PrintAndLogEx(WARNING, "ISO ID list returned no data"); } From 5858d1ffb313a029777722c46c1d2450212fd032 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Thu, 29 Jul 2021 18:45:04 +0300 Subject: [PATCH 2/2] coverity --- client/src/cmdhfmfdes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index 72f95fdef..f646811f4 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -5732,7 +5732,7 @@ static int DesfileReadFileAndPrint(DesfireContext *dctx, uint8_t fnum, int filet if (resplen > 0) { size_t reccount = resplen / reclen; - PrintAndLogEx(SUCCESS, "Read %u bytes from file 0x%02x from record %d record count %zu record length %zu", resplen, fnum, offset, reccount, reclen); + PrintAndLogEx(SUCCESS, "Read %zu bytes from file 0x%02x from record %d record count %zu record length %zu", resplen, fnum, offset, reccount, reclen); if (reccount > 1) PrintAndLogEx(SUCCESS, "Lastest record at the bottom."); for (int i = 0; i < reccount; i++) {