From 20c5cfb2269c1bd7082161e2589630067e46412e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Franke?= Date: Sat, 15 Aug 2026 12:41:10 +0200 Subject: [PATCH] Fixed return value checking for loadFileDICTIONARYEx --- client/src/cmdhfmfdes.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index 04dbef5f2..b71da8c7e 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -1714,10 +1714,10 @@ static int CmdHF14aDesChk(const char *Cmd) { if (desReadEnd != 0) { res = loadFileDICTIONARYEx((char *)dict_filename, deskeyList, sizeof(deskeyList), NULL, 8, &keycnt, desReadStart, &desReadEnd, false); - if (res == 1) { + if (res == PM3_SUCCESS) deskeyListLen = keycnt; + else desReadStart = desReadEnd; - } } else { // Every 16 byte or 24 byte key also gets read as a valid des key (whether that is good or not is up for debate) // but this has as a consequence that when desReadEnd == 0 there are absolutely no more keys of any kind left in the dictionary @@ -1727,19 +1727,19 @@ static int CmdHF14aDesChk(const char *Cmd) { keycnt = 0; if (aesReadEnd != 0) { res = loadFileDICTIONARYEx((char *)dict_filename, aeskeyList, sizeof(aeskeyList), NULL, 16, &keycnt, aesReadStart, &aesReadEnd, false); - if (res == 1) { + if (res == PM3_SUCCESS) aeskeyListLen = keycnt; + else aesReadStart = aesReadEnd; - } } keycnt = 0; if (k3kReadEnd != 0) { res = loadFileDICTIONARYEx((char *)dict_filename, k3kkeyList, sizeof(k3kkeyList), NULL, 24, &keycnt, k3kReadStart, &k3kReadEnd, false); - if (res == 1) { + if (res == PM3_SUCCESS) k3kkeyListLen = keycnt; + else k3kReadStart = k3kReadEnd; - } } }