Merge pull request #1458 from merlokk/cov

Coverity
This commit is contained in:
Oleg Moiseenko 2021-08-16 19:30:55 +03:00 committed by GitHub
commit 49ccd6ae1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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"));
}

View file

@ -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) {