a few calloc checks, still many to go
This commit is contained in:
1 parent
74c60301d1
commit
c37ca881e6
12 files changed
+84
-1
No files matched your search
@@ -71,6 +71,10 @@ static char *GenerateFilename(iso14a_card_select_t *card, const char *prefix, co
|
||||
return NULL;
|
||||
}
|
||||
char *fptr = calloc(sizeof(char) * (strlen(prefix) + strlen(suffix)) + sizeof(card->uid) * 2 + 1, sizeof(uint8_t));
|
||||
if (fptr == NULL) {
|
||||
PrintAndLogEx(FAILED, "Memory allocation failed");
|
||||
return NULL;
|
||||
}
|
||||
strcpy(fptr, prefix);
|
||||
FillFileNameByUID(fptr, card->uid, suffix, card->uidlen);
|
||||
return fptr;
|
||||
|
||||
Reference in new issue
Block a user