From 7549f53b63446d9a2322e655317ad2b270e47746 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 6 Sep 2024 10:07:06 +0200 Subject: [PATCH] we use calloc --- client/src/cmdhficlass.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index 78c53b309..2c900fffc 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -3638,8 +3638,8 @@ static int CmdHFiClassCheckKeys(const char *Cmd) { } else { // Generate 5000 keys using VB6 KDF keycount = 5000; - keyBlock = malloc(keycount * 8); - if (!keyBlock) { + keyBlock = calloc(1, keycount * 8); + if (keyBlock == NULL) { return PM3_EMALLOC; } @@ -4229,8 +4229,8 @@ static int CmdHFiClassLookUp(const char *Cmd) { } else { // Generate 5000 keys using VB6 KDF keycount = 5000; - keyBlock = malloc(keycount * 8); - if (!keyBlock) { + keyBlock = calloc(1, keycount * 8); + if (keyBlock == NULL) { return PM3_EMALLOC; } @@ -4250,10 +4250,13 @@ static int CmdHFiClassLookUp(const char *Cmd) { PrintAndLogEx(INFO, "Generating diversified keys..."); GenerateMacKeyFrom(csn, CCNR, use_raw, use_elite, keyBlock, keycount, prekey); - if (use_elite) + if (use_elite) { PrintAndLogEx(INFO, "Using " _YELLOW_("elite algo")); - if (use_raw) + } + + if (use_raw) { PrintAndLogEx(INFO, "Using " _YELLOW_("raw mode")); + } PrintAndLogEx(INFO, "Sorting...");