filename checks

This commit is contained in:
iceman1001 2020-04-06 07:29:12 +02:00
parent 97f06ddcfb
commit b8bbc1d0a5

View file

@ -1031,12 +1031,11 @@ static int CmdLegicRestore(const char *Cmd) {
break; break;
} }
case 'f': { case 'f': {
int len = param_getstr(Cmd, cmdp + 1, filename, FILE_PATH_SIZE); if (param_getstr(Cmd, cmdp + 1, filename, FILE_PATH_SIZE) >= FILE_PATH_SIZE) {
if (!len) PrintAndLogEx(FAILED, "Filename too long");
errors = true; break;
else }
have_filename = true; have_filename = true;
cmdp += 2; cmdp += 2;
break; break;
} }
@ -1147,12 +1146,11 @@ static int CmdLegicELoad(const char *Cmd) {
return usage_legic_eload(); return usage_legic_eload();
} }
case 'f' : { case 'f' : {
int len = param_getstr(Cmd, cmdp + 1, filename, FILE_PATH_SIZE); if (param_getstr(Cmd, cmdp + 1, filename, FILE_PATH_SIZE) >= FILE_PATH_SIZE) {
if (!len) PrintAndLogEx(FAILED, "Filename too long");
errors = true; break;
else }
have_filename = true; have_filename = true;
cmdp += 2; cmdp += 2;
break; break;
} }