summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b0c68b7)
also initialize filename variable so not null
found by iceman1001
//Open the tagdump-file
FILE *f;
char filename[FILE_PATH_SIZE];
//Open the tagdump-file
FILE *f;
char filename[FILE_PATH_SIZE];
- if(opt == 'f' && param_getstr(Cmd, 1, filename) > 0)
- {
+ if(opt == 'f' && param_getstr(Cmd, 1, filename) > 0) {
f = fopen(filename, "rb");
f = fopen(filename, "rb");
+ if ( f == NULL ) {
+ PrintAndLog("Could not find file %s", filename);
+ return 1;
+ }
+ } else {
return usage_hf_iclass_decrypt();
}
return usage_hf_iclass_decrypt();
}
}
int CmdHFiClassCloneTag(const char *Cmd) {
}
int CmdHFiClassCloneTag(const char *Cmd) {
- char filename[FILE_PATH_SIZE];
+ char filename[FILE_PATH_SIZE] = {0};
char tempStr[50]={0};
uint8_t KEY[8]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
uint8_t keyNbr = 0;
char tempStr[50]={0};
uint8_t KEY[8]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
uint8_t keyNbr = 0;
if (startblock<5) {
PrintAndLog("You cannot write key blocks this way. yet... make your start block > 4");
if (startblock<5) {
PrintAndLog("You cannot write key blocks this way. yet... make your start block > 4");
return 0;
}
// now read data from the file from block 6 --- 19
return 0;
}
// now read data from the file from block 6 --- 19