X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/bf32dd923f3fbbfaa0932390fb1a771d03d0cf45..2b9006bd143dd37ea79fb746196289b2a0843e8e:/client/cmdhficlass.c diff --git a/client/cmdhficlass.c b/client/cmdhficlass.c index f17f96ca..7f0779b6 100644 --- a/client/cmdhficlass.c +++ b/client/cmdhficlass.c @@ -1021,7 +1021,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};