]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhfepa.c
FIX: Coverity, out-of-bounds write, CID# 121336, s_index should take factor in consi...
[proxmark3-svn] / client / cmdhfepa.c
index 44a539c89e3a8ed92c7a29af3896e353bfe7e58a..ed903cf64ce6dbc26d7e3017164db1f2d402cdc3 100644 (file)
@@ -29,9 +29,9 @@ int CmdHFEPACollectPACENonces(const char *Cmd)
        unsigned int n = 0;
        // delay between requests
        unsigned int d = 0;
-       
+
        sscanf(Cmd, "%u %u %u", &m, &n, &d);
-       
+
        // values are expected to be > 0
        m = m > 0 ? m : 1;
        n = n > 0 ? n : 1;
@@ -44,7 +44,7 @@ int CmdHFEPACollectPACENonces(const char *Cmd)
                UsbCommand c = {CMD_EPA_PACE_COLLECT_NONCE, {(int)m, 0, 0}};
                SendCommand(&c);
                UsbCommand resp;
-    
+
                WaitForResponse(CMD_ACK,&resp);
 
                // check if command failed
@@ -58,13 +58,13 @@ int CmdHFEPACollectPACENonces(const char *Cmd)
                        }
                        // print nonce
                        PrintAndLog("Length: %d, Nonce: %s", nonce_length, nonce);
+                       free(nonce);
                }
                if (i < n - 1) {
                        sleep(d);
                }
        }
        PrintAndLog("End: %u", time(NULL));
-
        return 1;
 }
 
@@ -178,7 +178,7 @@ int CmdHFEPAPACEReplay(const char *Cmd)
 
 // UI-related stuff
 
-static const command_t CommandTable[] = 
+static const command_t CommandTable[] =
 {
   {"help",    CmdHelp,                   1, "This help"},
   {"cnonces", CmdHFEPACollectPACENonces, 0,
Impressum, Datenschutz