From f5efcc43f0e9a69fff5f65818227846df6204b58 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 2 Jun 2020 11:54:31 +0200 Subject: [PATCH] fix coverity 290111 --- client/src/cmdhfmfdes.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index 06e11ef1e..d56218e4b 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -4073,15 +4073,22 @@ static int CmdHF14aDesChk(const char *Cmd) { if (dict_filenamelen && endFilePosition) { if (!verbose) printf("d"); + uint32_t keycnt = 0; res = loadFileDICTIONARYEx((char *)dict_filename, deskeyList, sizeof(deskeyList), NULL, 16, &keycnt, endFilePosition, &endFilePosition, false); - deskeyListLen = keycnt; + if (res == PM3_SUCCESS && endFilePosition) + deskeyListLen = keycnt; + keycnt = 0; res = loadFileDICTIONARYEx((char *)dict_filename, aeskeyList, sizeof(aeskeyList), NULL, 16, &keycnt, endFilePosition, &endFilePosition, false); - aeskeyListLen = keycnt; + if (res == PM3_SUCCESS && endFilePosition) + aeskeyListLen = keycnt; + keycnt = 0; res = loadFileDICTIONARYEx((char *)dict_filename, k3kkeyList, sizeof(k3kkeyList), NULL, 16, &keycnt, endFilePosition, &endFilePosition, false); - k3kkeyListLen = keycnt; + if (res == PM3_SUCCESS && endFilePosition) + k3kkeyListLen = keycnt; + continue; } }