]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhficlass.c
FIX: Coverity, resource leak, and variable can't be negative,
[proxmark3-svn] / client / cmdhficlass.c
index 047bf1375b46df624e96a6fb4d752095b144d9d4..ec1b2c8ac697eb9cc33a6281b0e613225cb3b1d5 100644 (file)
@@ -943,7 +943,7 @@ int usage_hf_iclass_clone(void) {
 }
 
 int CmdHFiClassCloneTag(const char *Cmd) {
-       char filename[FILE_PATH_SIZE];
+       char filename[FILE_PATH_SIZE] = { 0x00 };
        char tempStr[50]={0};
        uint8_t KEY[8]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
        uint8_t keyNbr = 0;
@@ -1048,6 +1048,7 @@ int CmdHFiClassCloneTag(const char *Cmd) {
 
        if (startblock<5) {
                PrintAndLog("You cannot write key blocks this way. yet... make your start block > 4");
+               fclose(f);      
                return 0;
        }
        // now read data from the file from block 6 --- 19
Impressum, Datenschutz