]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
FIX: coverty scan defects.
authoriceman1001 <iceman@iuse.se>
Fri, 8 Jan 2016 14:28:24 +0000 (15:28 +0100)
committericeman1001 <iceman@iuse.se>
Fri, 8 Jan 2016 14:28:24 +0000 (15:28 +0100)
- bigbuf.c  is comparision correct (iLen versus numofparity)
- cmdhfepa.c  resourceleak, add a call to free
- cipherutils.c  resourceleak, added calls to free

armsrc/BigBuf.c
client/cmdhfepa.c
client/loclass/cipherutils.c

index 64ad91ff6cc64e359f8c0cd827792f4f6c766e25..f3f23ddc9fe40b56004c1fe27e93fce17b1900ec 100644 (file)
@@ -184,7 +184,7 @@ bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_
        traceLen += iLen;
 
        // parity bytes
        traceLen += iLen;
 
        // parity bytes
-       if (iLen != 0) {
+       if (num_paritybytes != 0) {
                if (parity != NULL) {
                        memcpy(trace + traceLen, parity, num_paritybytes);
                } else {
                if (parity != NULL) {
                        memcpy(trace + traceLen, parity, num_paritybytes);
                } else {
index e9c63f20b02f7f88fae741f4e24780a763bff910..ed903cf64ce6dbc26d7e3017164db1f2d402cdc3 100644 (file)
@@ -58,13 +58,13 @@ int CmdHFEPACollectPACENonces(const char *Cmd)
                        }
                        // print nonce
                        PrintAndLog("Length: %d, Nonce: %s", nonce_length, nonce);
                        }
                        // print nonce
                        PrintAndLog("Length: %d, Nonce: %s", nonce_length, nonce);
+                       free(nonce);
                }
                if (i < n - 1) {
                        sleep(d);
                }
        }
        PrintAndLog("End: %u", time(NULL));
                }
                if (i < n - 1) {
                        sleep(d);
                }
        }
        PrintAndLog("End: %u", time(NULL));
-
        return 1;
 }
 
        return 1;
 }
 
index 83b3c9fa2476f6454ac507e777224617795a3bd3..9a8256bb38a700990fe6bddf4701116cdbaeac40 100644 (file)
@@ -171,6 +171,7 @@ void printarr(char * name, uint8_t* arr, int len)
        }
        cx += snprintf(output+cx,outsize-cx,"};");
        prnlog(output);
        }
        cx += snprintf(output+cx,outsize-cx,"};");
        prnlog(output);
+       free(output);
 }
 
 void printvar(char * name, uint8_t* arr, int len)
 }
 
 void printvar(char * name, uint8_t* arr, int len)
@@ -188,6 +189,7 @@ void printvar(char * name, uint8_t* arr, int len)
        }
 
        prnlog(output);
        }
 
        prnlog(output);
+       free(output);
 }
 
 void printarr_human_readable(char * title, uint8_t* arr, int len)
 }
 
 void printarr_human_readable(char * title, uint8_t* arr, int len)
Impressum, Datenschutz