]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhficlass.c
FIX, Coverity, Argument can't be negative. CID# 212322, ftell(f) can …
[proxmark3-svn] / client / cmdhficlass.c
index a169e827663f7fd0e13247d100784b31418c11c8..67bcbe766d476e78e116f1982a499fa0efd8aaab 100644 (file)
@@ -285,6 +285,7 @@ int CmdHFiClassELoad(const char *Cmd) {
 
        if (fsize < 0) {
                PrintAndLog("Error, when getting filesize");
+               fclose(f);
                return 1;
        }
 
@@ -1506,6 +1507,12 @@ static int loadKeys(char *filename) {
        long fsize = ftell(f);
        fseek(f, 0, SEEK_SET);
 
+       if ( fsize < 0 ) {
+               PrintAndLog("Error, when getting filesize");
+               fclose(f);
+               return 1;
+       }
+
        uint8_t *dump = malloc(fsize);
 
        size_t bytes_read = fread(dump, 1, fsize, f);
Impressum, Datenschutz