From 1ce10cfea6da4d278c93203e7318f17a9d6bfaf5 Mon Sep 17 00:00:00 2001
From: Matthias Konrath <office@inet-sec.at>
Date: Wed, 28 Aug 2019 10:09:01 +0200
Subject: [PATCH] Added additional checks (loadFileDICTIONARY_safe).

---
 client/cmdlft55xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/client/cmdlft55xx.c b/client/cmdlft55xx.c
index 48baea594..f17c8e192 100644
--- a/client/cmdlft55xx.c
+++ b/client/cmdlft55xx.c
@@ -2129,7 +2129,7 @@ static int CmdT55xxChkPwds(const char *Cmd) {
         uint16_t keycount = 0;
 
         int res = loadFileDICTIONARY_safe(filename, &keyBlock, 4, &keycount);
-        if (res || keycount <= 0 || keyBlock == NULL) {
+        if (res != PM3_SUCCESS || keycount <= 0 || keyBlock == NULL) {
             PrintAndLogEx(WARNING, "No keys found in file");
             if (keyBlock != NULL) free(keyBlock);
             return PM3_ESOFT;