This commit is contained in:
iceman1001 2023-03-04 20:32:34 +01:00
commit f9da8615e4
2 changed files with 4 additions and 3 deletions

View file

@ -2973,7 +2973,8 @@ all_found:
free(fptr);
return PM3_ESOFT;
}
strcpy(filename, fptr);
strncpy(filename, fptr, sizeof(filename) - 1);
free(fptr);
saveFile(filename, ".bin", dump, bytes);
@ -5411,7 +5412,7 @@ static int CmdHF14AMfice(const char *Cmd) {
fptr = GenerateFilename("hf-mf-", "-nonces.bin");
if (fptr == NULL)
return PM3_EFILE;
strcpy(filename, fptr);
strncpy(filename, fptr, sizeof(filename) - 1);
free(fptr);
}

View file

@ -2870,7 +2870,7 @@ static int CmdHF14AMfURestore(const char *Cmd) {
if (fnlen == 0) {
char *fptr = GenerateFilename("hf-mfu-", "-dump.bin");
if (fptr != NULL) {
strcpy(filename, fptr);
strncpy(filename, fptr, sizeof(filename) - 1);
} else {
snprintf(filename, sizeof(filename), "dumpdata.bin");
}