FIX: Coverity, Dereference null return, CID #212329, filehandle could be NULL

This commit is contained in:
iceman1001 2016-01-12 22:57:23 +01:00
commit 3c40616979

View file

@ -374,10 +374,13 @@ int CmdHFiClassDecrypt(const char *Cmd) {
//Open the tagdump-file //Open the tagdump-file
FILE *f; FILE *f;
char filename[FILE_PATH_SIZE]; char filename[FILE_PATH_SIZE];
if(opt == 'f' && param_getstr(Cmd, 1, filename) > 0) if(opt == 'f' && param_getstr(Cmd, 1, filename) > 0) {
{ if ( (f = fopen(filename, "rb")) == NULL) {
f = fopen(filename, "rb"); PrintAndLog("Could not find file %s", filename);
}else{ return 1;
}
} else {
return usage_hf_iclass_decrypt(); return usage_hf_iclass_decrypt();
} }