From 5c065fa089f7864548bb91ef4779cf6ec054319f Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 13 Nov 2014 22:02:36 +0100 Subject: [PATCH] FIX: Corrected the bug mention http://www.proxmark.org/forum/viewtopic.php?id=1612 filepath too short in "hf mf eload / esave / cload / csave" commands. Length was 14, is now 250. Should be enough for awhile. --- client/cmdhfmf.c | 16 ++++++++-------- client/mifarehost.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 8a48c19c..4b620275 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -1419,7 +1419,7 @@ int CmdHF14AMfESet(const char *Cmd) int CmdHF14AMfELoad(const char *Cmd) { FILE * f; - char filename[20]; + char filename[255]; char *fnameptr = filename; char buf[64]; uint8_t buf8[64]; @@ -1436,7 +1436,7 @@ int CmdHF14AMfELoad(const char *Cmd) } len = strlen(Cmd); - if (len > 14) len = 14; + if (len > 250) len = 250; memcpy(filename, Cmd, len); fnameptr += len; @@ -1494,7 +1494,7 @@ int CmdHF14AMfELoad(const char *Cmd) int CmdHF14AMfESave(const char *Cmd) { FILE * f; - char filename[20]; + char filename[255]; char * fnameptr = filename; uint8_t buf[64]; int i, j, len; @@ -1511,7 +1511,7 @@ int CmdHF14AMfESave(const char *Cmd) } len = strlen(Cmd); - if (len > 14) len = 14; + if (len > 250) len = 250; if (len < 1) { // get filename @@ -1687,7 +1687,7 @@ int CmdHF14AMfCSetBlk(const char *Cmd) int CmdHF14AMfCLoad(const char *Cmd) { FILE * f; - char filename[20]; + char filename[255]; char * fnameptr = filename; char buf[64]; uint8_t buf8[64]; @@ -1728,7 +1728,7 @@ int CmdHF14AMfCLoad(const char *Cmd) return 0; } else { len = strlen(Cmd); - if (len > 14) len = 14; + if (len > 250) len = 250; memcpy(filename, Cmd, len); fnameptr += len; @@ -1851,7 +1851,7 @@ int CmdHF14AMfCGetSc(const char *Cmd) { int CmdHF14AMfCSave(const char *Cmd) { FILE * f; - char filename[20]; + char filename[255]; char * fnameptr = filename; uint8_t fillFromEmulator = 0; uint8_t buf[64]; @@ -1893,7 +1893,7 @@ int CmdHF14AMfCSave(const char *Cmd) { return 0; } else { len = strlen(Cmd); - if (len > 14) len = 14; + if (len > 250) len = 250; if (len < 1) { // get filename diff --git a/client/mifarehost.c b/client/mifarehost.c index cda884d9..358799cb 100644 --- a/client/mifarehost.c +++ b/client/mifarehost.c @@ -216,7 +216,7 @@ int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount) { UsbCommand c = {CMD_MIFARE_EML_MEMGET, {blockNum, blocksCount, 0}}; SendCommand(&c); - UsbCommand resp; + UsbCommand resp; if (!WaitForResponseTimeout(CMD_ACK,&resp,1500)) return 1; memcpy(data, resp.d.asBytes, blocksCount * 16); return 0; -- 2.39.5