mirror of
https://github.com/Proxmark/proxmark3.git
synced 2024-09-21 07:16:24 +08:00
add check to fread call
This commit is contained in:
parent
098015eb75
commit
33c795d0bd
|
@ -1046,7 +1046,11 @@ int CmdHFiClassCloneTag(const char *Cmd) {
|
|||
// else we have to create a share memory
|
||||
int i;
|
||||
fseek(f,startblock*8,SEEK_SET);
|
||||
fread(tag_data,sizeof(iclass_block_t),endblock - startblock + 1,f);
|
||||
if ( fread(tag_data,sizeof(iclass_block_t),endblock - startblock + 1,f) == 0 ) {
|
||||
PrintAndLog("File reading error.");
|
||||
fclose(f);
|
||||
return 2;
|
||||
}
|
||||
|
||||
uint8_t MAC[4]={0x00,0x00,0x00,0x00};
|
||||
uint8_t div_key[8]={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
|
|
Loading…
Reference in a new issue