mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-03-22 21:17:31 +08:00
FIX: Coverity, Dereference null return, CID #212329, filehandle could be NULL
This commit is contained in:
parent
8b15860ed1
commit
3c40616979
1 changed files with 8 additions and 5 deletions
|
@ -374,12 +374,15 @@ int CmdHFiClassDecrypt(const char *Cmd) {
|
|||
//Open the tagdump-file
|
||||
FILE *f;
|
||||
char filename[FILE_PATH_SIZE];
|
||||
if(opt == 'f' && param_getstr(Cmd, 1, filename) > 0)
|
||||
{
|
||||
f = fopen(filename, "rb");
|
||||
}else{
|
||||
if(opt == 'f' && param_getstr(Cmd, 1, filename) > 0) {
|
||||
if ( (f = fopen(filename, "rb")) == NULL) {
|
||||
PrintAndLog("Could not find file %s", filename);
|
||||
return 1;
|
||||
}
|
||||
|
||||
} else {
|
||||
return usage_hf_iclass_decrypt();
|
||||
}
|
||||
}
|
||||
|
||||
fseek(f, 0, SEEK_END);
|
||||
long fsize = ftell(f);
|
||||
|
|
Loading…
Add table
Reference in a new issue