Added additional checks (loadFileDICTIONARY_safe).

This commit is contained in:
Matthias Konrath 2019-08-28 10:09:01 +02:00
parent ae7b0de2c9
commit 1ce10cfea6

View file

@ -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;