From 13963593a293239ad95bf0739289da216741a443 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Mon, 16 Aug 2021 19:11:14 +0300 Subject: [PATCH 1/2] cov 354821 --- 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 e04d27774..ce8844aae 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -5058,7 +5058,7 @@ static int CmdHF14ADesWriteData(const char *Cmd) { if (verbose) { if (readeridpushed) - PrintAndLogEx(INFO, "TMC and TMV[%d]: %s", resplen, sprint_hex(resp, resplen)); + PrintAndLogEx(INFO, "TMC and TMV[%zu]: %s", resplen, sprint_hex(resp, resplen)); PrintAndLogEx(INFO, "Commit " _GREEN_("OK")); } From c8330b13d22cc054ac59c0b67af5aa5e31d9bdc5 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Mon, 16 Aug 2021 19:30:28 +0300 Subject: [PATCH 2/2] cov 354842 --- client/src/mifare/lrpcrypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/mifare/lrpcrypto.c b/client/src/mifare/lrpcrypto.c index 71ddce201..e274b660b 100644 --- a/client/src/mifare/lrpcrypto.c +++ b/client/src/mifare/lrpcrypto.c @@ -248,7 +248,7 @@ void LRPCMAC(LRPContext *ctx, uint8_t *data, size_t datalen, uint8_t *cmac) { size_t bllen = datalen - clen; uint8_t bl[CRYPTO_AES128_KEY_SIZE] = {0}; - memcpy(bl, &data[clen], bllen); + memcpy(bl, &data[clen], MIN(bllen, CRYPTO_AES128_KEY_SIZE)); // last block if (bllen == 16) {